projects
/
project
/
fstools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
649cd3f
)
libfstools: avoid segfault in find_mount_point
author
Stijn Tintel
<stijn@linux-ipv6.be>
Tue, 21 Dec 2021 17:37:03 +0000
(19:37 +0200)
committer
Stijn Tintel
<stijn@linux-ipv6.be>
Sat, 5 Feb 2022 16:01:25 +0000
(18:01 +0200)
If block is NULL, find_mount_point will segfault when comparing it
against the device name found in /proc/self/mountinfo. Avoid this by
checking if block is NULL.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
libfstools/find.c
patch
|
blob
|
history
diff --git
a/libfstools/find.c
b/libfstools/find.c
index cefdd23e26891bba28d038bcbcd1aed3c67bb337..1d91c515b42070406dee79a00dcc5f0575f8a0fd 100644
(file)
--- a/
libfstools/find.c
+++ b/
libfstools/find.c
@@
-109,6
+109,9
@@
find_mount_point(char *block, int root_only)
int rstat;
unsigned int minor, major;
+ if (!block)
+ return NULL;
+
if (!fp)
return NULL;