]> granicus.if.org Git - icinga2/commitdiff
Process: Fix JSON parsing error on process helper crash 5500/head
authorNoah Hilverling <noah.hilverling@icinga.com>
Mon, 14 Aug 2017 06:27:04 +0000 (08:27 +0200)
committerNoah Hilverling <noah.hilverling@icinga.com>
Mon, 14 Aug 2017 06:27:04 +0000 (08:27 +0200)
lib/base/process.cpp

index 9107b7f88f284b8b88aba9c5b54c0e0623010607..178dcbbea1cb7eaee9e088a3ca9ea1e06c1eba6c 100644 (file)
@@ -415,7 +415,7 @@ send_message:
 
        ssize_t rc = recv(l_ProcessControlFD, buf, sizeof(buf), 0);
 
-       if (rc < 0)
+       if (rc <= 0)
                return -1;
 
        String jresponse = String(buf, buf + rc);
@@ -447,7 +447,7 @@ send_message:
 
        ssize_t rc = recv(l_ProcessControlFD, buf, sizeof(buf), 0);
 
-       if (rc < 0)
+       if (rc <= 0)
                return -1;
 
        String jresponse = String(buf, buf + rc);
@@ -478,7 +478,7 @@ send_message:
 
        ssize_t rc = recv(l_ProcessControlFD, buf, sizeof(buf), 0);
 
-       if (rc < 0)
+       if (rc <= 0)
                return -1;
 
        String jresponse = String(buf, buf + rc);