From: Amos Jeffries Date: Wed, 19 Nov 2014 22:29:50 +0000 (-0800) Subject: ParserNG: fix typo in rev.13688 X-Git-Tag: merge-candidate-3-v1~484 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b52d3cdbdd10a3e675cdf0e07094f4954a3da9c;p=thirdparty%2Fsquid.git ParserNG: fix typo in rev.13688 Squid xstrncpy() assumes \0-termination and enforces it by overwriting the last byte of the output. Un-terminated strings must have +1 length delivered or they will be truncated. --- diff --git a/src/http/one/Parser.cc b/src/http/one/Parser.cc index 07696c80cf..10ed3603dc 100644 --- a/src/http/one/Parser.cc +++ b/src/http/one/Parser.cc @@ -71,7 +71,7 @@ Http::One::Parser::getHeaderField(const char *name) p.chop(0, sizeof(header)-1); // return the header field-value - xstrncpy(header, p.rawContent(), p.length()); + xstrncpy(header, p.rawContent(), p.length()+1); debugs(25, 5, "returning " << header); return header; }