diff options
author | Daniel Kahn Gillmor <[email protected]> | 2016-10-26 03:55:07 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2016-10-26 05:16:06 +0000 |
commit | 3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6 (patch) | |
tree | d3af0343fc664d9ad411e4ecdefce7d1ef891195 /common/sysutils.c | |
parent | agent,tests,w32: Fix relaying pinentry user data, fix fake-pinentry. (diff) | |
download | gnupg-3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6.tar.gz gnupg-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 <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | common/sysutils.c | 3 |
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 (); |