[squid-dev] Http::One::Parser::getHeaderField bug

Tsantilas Christos chtsanti at users.sourceforge.net
Wed Nov 12 16:34:32 UTC 2014


The following patch is fixing it:

=== modified file 'src/http/one/Parser.cc'
--- src/http/one/Parser.cc      2014-09-14 12:43:00 +0000
+++ src/http/one/Parser.cc      2014-11-12 16:31:08 +0000
@@ -71,7 +71,7 @@
          p.chop(0, sizeof(header)-1);

          // return the header field-value
-        xstrncpy(header, p.rawContent(), p.length());
+        strcpy(header, p.c_str());
          debugs(25, 5, "returning " << header);
          return header;
      }


Does this looks like an SBuf bug?


On 11/12/2014 05:03 PM, Tsantilas Christos wrote:
> Hi all,
>    This method eats the last char of the returning value.
>
> For example:
>   -  The request include Host header:
>      Host: www.paypal.com
>
>   - The host = hp->getHeaderField("Host"), will return "www.paypal.co"
>
> This method used from the prepareAcceleratedURL.
> _______________________________________________
> squid-dev mailing list
> squid-dev at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev



More information about the squid-dev mailing list