]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
unshare: make strings more robust
authorKarel Zak <kzak@redhat.com>
Wed, 12 Mar 2025 14:05:47 +0000 (15:05 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 17 Mar 2025 11:21:53 +0000 (12:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit ad591f1a8e5917cd41d91de18626494e072414f8)

sys-utils/unshare.c

index d5ce369c2b4d80cdb1dcfc1afcd100ffa4c4bef8..0490c153294feee3846c3e4b420239f1fa666523 100644 (file)
@@ -737,7 +737,7 @@ static int is_fixed(const char *interp)
 
        flags = strrchr(interp, ':');
 
-       return strchr(flags, 'F') != NULL;
+       return flags && strchr(flags, 'F') != NULL;
 }
 
 static void load_interp(const char *binfmt_mnt, const char *interp)