From 922f1b3c091dbe12af4ba12a76ba8563418b688c Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 21 Dec 2021 19:37:03 +0200 Subject: 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 --- libfstools/find.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- cgit v1.2.1