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>
This commit is contained in:
Daniel Kahn Gillmor 2016-10-25 23:55:07 -04:00 committed by NIIBE Yutaka
parent 852b8f0b89
commit 3b5f5e0eb0
1 changed files with 3 additions and 0 deletions

View File

@ -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 ();