瀏覽代碼

fix off-by-one error in HttpMethod::​AutoDetectProxy()

Michael Vogt 13 年之前
父節點
當前提交
c104200045
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      methods/http.cc

+ 1 - 1
methods/http.cc

@@ -1401,7 +1401,7 @@ bool HttpMethod::AutoDetectProxy()
    char buf[512];
    int InFd = Pipes[0];
    close(Pipes[1]);
-   int res = read(InFd, buf, sizeof(buf));
+   int res = read(InFd, buf, sizeof(buf)-1);
    ExecWait(Process, "ProxyAutoDetect", true);
 
    if (res < 0)