projects
/
ostree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4f1d18
)
mount: Fix gcc -fanalyzer warning for parsing androidboot.slot_suffix
author
Colin Walters
<walters@verbum.org>
Fri, 14 Jul 2023 10:51:34 +0000
(06:51 -0400)
committer
Colin Walters
<walters@verbum.org>
Fri, 14 Jul 2023 10:51:34 +0000
(06:51 -0400)
If the karg wasn't present, we'd do a NULL deref which is undefined
behavior.
src/switchroot/ostree-mount-util.h
patch
|
blob
|
history
diff --git
a/src/switchroot/ostree-mount-util.h
b/src/switchroot/ostree-mount-util.h
index 7c7c6ce18a4fd9f1cd252f5269b6b537e85a1a65..180ab2e4e424d4a4fc9e6f4146f24111c13d761d 100644
(file)
--- a/
src/switchroot/ostree-mount-util.h
+++ b/
src/switchroot/ostree-mount-util.h
@@
-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)