diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 61e20c40a87..7fe88454296 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -996,6 +996,8 @@ static int boot_config_find(const BootConfig *config, const char *id) { if (id[0] == '@') { if (!strcaseeq(id, "@saved")) return -1; + if (!config->entry_selected) + return -1; id = config->entry_selected; } diff --git a/test/fuzz/fuzz-bootspec/clusterfuzz-testcase-minimized-fuzz-bootspec-5731869371269120 b/test/fuzz/fuzz-bootspec/clusterfuzz-testcase-minimized-fuzz-bootspec-5731869371269120 new file mode 100644 index 00000000000..8804abd0945 --- /dev/null +++ b/test/fuzz/fuzz-bootspec/clusterfuzz-testcase-minimized-fuzz-bootspec-5731869371269120 @@ -0,0 +1 @@ +{"config":"default @saved","loader":[""]} \ No newline at end of file