summaryrefslogtreecommitdiffstats
path: root/common/sysutils.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-10-26 05:55:07 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2016-10-26 07:16:06 +0200
commit3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6 (patch)
treed3af0343fc664d9ad411e4ecdefce7d1ef891195 /common/sysutils.c
parentagent,tests,w32: Fix relaying pinentry user data, fix fake-pinentry. (diff)
downloadgnupg2-3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6.tar.xz
gnupg2-3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6.zip
common: avoid segfault
* common/sysutils.c (gnupg_inotify_watch_socket): return EINVAL if socket_name is NULL, rather than segfaulting -- Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'common/sysutils.c')
-rw-r--r--common/sysutils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/sysutils.c b/common/sysutils.c
index ab2012c45..ab3e1d6d5 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -987,6 +987,9 @@ gnupg_inotify_watch_socket (int *r_fd, const char *socket_name)
*r_fd = -1;
+ if (!socket_name)
+ return gpg_error (GPG_ERR_EINVAL);
+
fname = xtrystrdup (socket_name);
if (!fname)
return my_error_from_syserror ();