mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
bootctl: fix crash when parsing addon without .cmdline section
Follow-up for 706ca67d30
This commit is contained in:
@@ -783,9 +783,11 @@ static int find_cmdline_section(
|
||||
return 0;
|
||||
|
||||
r = pe_read_section_data(fd, pe_header, sections, ".cmdline", PE_SECTION_SIZE_MAX, (void**) &cmdline, NULL);
|
||||
if (r == -ENXIO) /* cmdline is optional */
|
||||
if (r == -ENXIO) { /* cmdline is optional */
|
||||
*ret_cmdline = NULL;
|
||||
else if (r < 0)
|
||||
return 0;
|
||||
}
|
||||
if (r < 0)
|
||||
return log_warning_errno(r, "Failed to read .cmdline section of '%s': %m", path);
|
||||
|
||||
word = strdup(cmdline);
|
||||
|
||||
Reference in New Issue
Block a user