Просмотр исходного кода

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

Michael Vogt лет назад: 13
Родитель
Сommit
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)