diff options
author | Stijn Tintel <stijn@linux-ipv6.be> | 2021-12-21 19:37:03 +0200 |
---|---|---|
committer | Stijn Tintel <stijn@linux-ipv6.be> | 2022-02-05 18:01:25 +0200 |
commit | 922f1b3c091dbe12af4ba12a76ba8563418b688c (patch) | |
tree | 249872b39405ff97496bc4054c4786d6a451f8cf | |
parent | 649cd3ff93418c94e6f3c316602319fc3f12cafa (diff) | |
download | fstools-922f1b3c091dbe12af4ba12a76ba8563418b688c.tar.gz |
libfstools: avoid segfault in find_mount_point
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>
-rw-r--r-- | libfstools/find.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libfstools/find.c b/libfstools/find.c index cefdd23..1d91c51 100644 --- 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; |