]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/path: fix possible NULL pointer dereferencing [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 15 May 2019 13:36:49 +0000 (15:36 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 15 May 2019 13:36:49 +0000 (15:36 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/path.c

index 00152f54c0ef284313b25520cb23be6944c85bcd..b3d66a45de4ec28791a16e3b292f9421ff9ba2f4 100644 (file)
@@ -308,6 +308,9 @@ int ul_path_accessf(struct path_cxt *pc, int mode, const char *path, ...)
        p = ul_path_mkpath(pc, path, ap);
        va_end(ap);
 
+       if (!p)
+               return -errno;
+
        return ul_path_access(pc, mode, p);
 }