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 <st...@linux-ipv6.be>
---
 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;
 
-- 
2.32.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to