From 9daa9e62de275a05405c63ba149b195b184de6c7 Mon Sep 17 00:00:00 2001 From: ckolivas Date: Mon, 27 Oct 2014 23:03:38 +1100 Subject: [PATCH] Add sanity check for invalidated sock in send_unix_msg --- src/libckpool.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libckpool.c b/src/libckpool.c index ce7d30e5..ad6be2ea 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -815,6 +815,10 @@ bool _send_unix_msg(int sockd, const char *buf, const char *file, const char *fu bool retval = false; int ret, ern; + if (unlikely(sockd < 0)) { + LOGWARNING("Attempting to send unix message to invalidated sockd %d", sockd); + goto out; + } if (unlikely(!buf)) { LOGWARNING("Null message sent to send_unix_msg"); goto out;