summaryrefslogtreecommitdiffstats
path: root/sys-utils/flock.c
diff options
context:
space:
mode:
authorKarel Zak2013-03-27 14:40:42 +0100
committerKarel Zak2013-03-27 14:40:42 +0100
commit3c7fbc82da796c21fd107221a218397af0764d30 (patch)
tree52c67abe96d56d53baab1fdb64a6b66bd291b842 /sys-utils/flock.c
parentgetopt: fix normalize() usage [coverity scan] (diff)
downloadkernel-qcow2-util-linux-3c7fbc82da796c21fd107221a218397af0764d30.tar.gz
kernel-qcow2-util-linux-3c7fbc82da796c21fd107221a218397af0764d30.tar.xz
kernel-qcow2-util-linux-3c7fbc82da796c21fd107221a218397af0764d30.zip
flock: possible pointer dereferences [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/flock.c')
-rw-r--r--sys-utils/flock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys-utils/flock.c b/sys-utils/flock.c
index 07f3484f6..3322e142d 100644
--- a/sys-utils/flock.c
+++ b/sys-utils/flock.c
@@ -255,6 +255,7 @@ int main(int argc, char *argv[])
*/
if (!(open_flags & O_RDWR) &&
type != LOCK_SH &&
+ filename &&
access(filename, R_OK | W_OK) == 0) {
close(fd);