Skip to content

Commit

Permalink
Merge pull request #2932 from cgwalters/aboot-fix-nullderef
Browse files Browse the repository at this point in the history
mount: Fix gcc -fanalyzer warning for parsing androidboot.slot_suffix
  • Loading branch information
ericcurtin authored Jul 14, 2023
2 parents c4f1d18 + c078e8b commit c1ac6bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/switchroot/ostree-mount-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ static inline char *
get_aboot_root_slot (void)
{
autofree char *slot_suffix = read_proc_cmdline_key ("androidboot.slot_suffix");
if (!slot_suffix)
errx (EXIT_FAILURE, "Missing androidboot.slot_suffix");

if (strcmp (slot_suffix, "_a") == 0)
return strdup ("/ostree/root.a");
else if (strcmp (slot_suffix, "_b") == 0)
Expand Down

0 comments on commit c1ac6bc

Please sign in to comment.