shared/bootspec: avoid crashing on config without a value
This commit is contained in:
@@ -127,6 +127,13 @@ static int boot_entry_load_type1(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isempty(p)) {
|
||||
/* Some fields can reasonably have an empty value. In other cases warn. */
|
||||
if (!STR_IN_SET(field, "options", "devicetree-overlay"))
|
||||
log_warning("%s:%u: Field %s without value", tmp.path, line, field);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (streq(field, "title"))
|
||||
r = free_and_strdup(&tmp.title, p);
|
||||
else if (streq(field, "sort-key"))
|
||||
|
||||
Reference in New Issue
Block a user