From: Amos Jeffries Date: Wed, 2 Dec 2009 22:27:33 +0000 (+1300) Subject: Bug 2830: clarify where NULL byte is in headers. X-Git-Tag: SQUID_3_2_0_1~523 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d8a896bab089eecdd9b17e80df41976e7c2fba4;p=thirdparty%2Fsquid.git Bug 2830: clarify where NULL byte is in headers. Debug printing used to naturally stop string output at the null byte. This should show the first segment of headers up to the NULL and the segment of headers after it. So that its clear to admin that there are more headers _after_ the portion that used to be logged. --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index e0fba7b686..f6a91b9de1 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -514,9 +514,10 @@ HttpHeader::parse(const char *header_start, const char *header_end) debugs(55, 7, "parsing hdr: (" << this << ")" << std::endl << getStringPrefix(header_start, header_end)); HttpHeaderStats[owner].parsedCount++; - if (memchr(header_start, '\0', header_end - header_start)) { + char *nulpos; + if (nulpos = memchr(header_start, '\0', header_end - header_start)) { debugs(55, 1, "WARNING: HTTP header contains NULL characters {" << - getStringPrefix(header_start, header_end) << "}"); + getStringPrefix(header_start, nulpos) << "}\nNULL\n{" << getStringPrefix(nulpos+1, header_end)); goto reset; }