From 3b5f5e0eb02ecbdcf59722755f22a9d2f88de6e6 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Tue, 25 Oct 2016 23:55:07 -0400 Subject: [PATCH] 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 --- common/sysutils.c | 3 +++ 1 file changed, 3 insertions(+) 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 ();