summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2019-05-15 15:36:49 +0200
committerKarel Zak2019-05-15 15:36:49 +0200
commitb24650294d707b95379a2d368d62a6addbda25f4 (patch)
tree58fda7b046237c3a74389773945a44009cdc2954 /lib
parentcolumn: fix "maybe be" duplication (diff)
downloadkernel-qcow2-util-linux-b24650294d707b95379a2d368d62a6addbda25f4.tar.gz
kernel-qcow2-util-linux-b24650294d707b95379a2d368d62a6addbda25f4.tar.xz
kernel-qcow2-util-linux-b24650294d707b95379a2d368d62a6addbda25f4.zip
lib/path: fix possible NULL pointer dereferencing [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/path.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/path.c b/lib/path.c
index 00152f54c..b3d66a45d 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);
}