]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tunnel.cc
Merged from trunk rev.13970
[thirdparty/squid.git] / src / tunnel.cc
index 9dfcb7dd8de58ce9981cb9a9192e1ecb14fc1b44..6e3b836d35f05059a375b99aad65c67cf8e61ce5 100644 (file)
@@ -413,7 +413,8 @@ TunnelStateData::handleConnectResponse(const size_t chunkSize)
     HttpReply rep;
     Http::StatusCode parseErr = Http::scNone;
     const bool eof = !chunkSize;
-    const bool parsed = rep.parse(connectRespBuf, eof, &parseErr);
+    connectRespBuf->terminate(); // HttpMsg::parse requires terminated string
+    const bool parsed = rep.parse(connectRespBuf->content(), connectRespBuf->contentSize(), eof, &parseErr);
     if (!parsed) {
         if (parseErr > 0) { // unrecoverable parsing error
             server.logicError("malformed CONNECT response from peer");