]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix off-by-one error in rev.13834
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Jan 2015 15:16:24 +0000 (07:16 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Jan 2015 15:16:24 +0000 (07:16 -0800)
 Detected by Coverity Scan. Issue 1264388.

src/ipc.cc

index 56b4ed07206d8180ff87f78831f537bda3dce498..03f4d7812d1f163e5c6491785a3b8e08342d1db3 100644 (file)
@@ -251,7 +251,7 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name
         else
             x = read(prfd, hello_buf, sizeof(hello_buf)-1);
         if (x >= 0)
-            hello_buf[x+1] = '\0';
+            hello_buf[x] = '\0';
 
         if (x < 0) {
             debugs(54, DBG_CRITICAL, "ipcCreate: PARENT: hello read test failed");