Skip to content

Commit f3b4ad8

Browse files
yuwatalnykryn
authored andcommitted
bootspec: fix null-dereference-read
Fixes [oss-fuzz#53578](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53578). Fixes #25450. (cherry picked from commit 46dc071) Resolves: RHEL-36284
1 parent ddf2ccf commit f3b4ad8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/shared/bootspec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,8 @@ static int boot_config_find(const BootConfig *config, const char *id) {
996996
if (id[0] == '@') {
997997
if (!strcaseeq(id, "@saved"))
998998
return -1;
999+
if (!config->entry_selected)
1000+
return -1;
9991001
id = config->entry_selected;
10001002
}
10011003

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"config":"default @saved","loader":[""]}

0 commit comments

Comments
 (0)