From: Karel Zak Date: Wed, 15 May 2019 13:36:49 +0000 (+0200) Subject: lib/path: fix possible NULL pointer dereferencing [coverity scan] X-Git-Tag: v2.34-rc2~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b24650294d707b95379a2d368d62a6addbda25f4;p=thirdparty%2Futil-linux.git lib/path: fix possible NULL pointer dereferencing [coverity scan] Signed-off-by: Karel Zak --- diff --git a/lib/path.c b/lib/path.c index 00152f54c0..b3d66a45de 100644 --- a/lib/path.c +++ b/lib/path.c @@ -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); }