1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-11-10 21:38:50 +01:00

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

View File

@ -987,6 +987,9 @@ gnupg_inotify_watch_socket (int *r_fd, const char *socket_name)
*r_fd = -1; *r_fd = -1;
if (!socket_name)
return gpg_error (GPG_ERR_EINVAL);
fname = xtrystrdup (socket_name); fname = xtrystrdup (socket_name);
if (!fname) if (!fname)
return my_error_from_syserror (); return my_error_from_syserror ();