From: Noah Hilverling Date: Mon, 14 Aug 2017 06:27:04 +0000 (+0200) Subject: Process: Fix JSON parsing error on process helper crash X-Git-Tag: v2.8.0~121^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F5500%2Fhead;p=icinga2 Process: Fix JSON parsing error on process helper crash --- diff --git a/lib/base/process.cpp b/lib/base/process.cpp index 9107b7f88..178dcbbea 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -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);