Skip to content

Commit

Permalink
bug 334700 - DEBUG null deref in LogHeaders r=biesi
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmanus committed Sep 6, 2012
1 parent 40da68f commit 59142e1
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions netwerk/protocol/http/nsHttpTransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID);

#if defined(PR_LOGGING)
static void
LogHeaders(const char *lines)
LogHeaders(const char *lineStart)
{
nsAutoCString buf;
char *p;
while ((p = PL_strstr(lines, "\r\n")) != nullptr) {
buf.Assign(lines, p - lines);
if (PL_strcasestr(buf.get(), "authorization: ") != nullptr) {
char *p = PL_strchr(PL_strchr(buf.get(), ' ')+1, ' ');
while (*++p) *p = '*';
char *endOfLine;
while ((endOfLine = PL_strstr(lineStart, "\r\n"))) {
buf.Assign(lineStart, endOfLine - lineStart);
if (PL_strcasestr(buf.get(), "authorization: ") ||
PL_strcasestr(buf.get(), "proxy-authorization: ")) {
char *p = PL_strchr(PL_strchr(buf.get(), ' ') + 1, ' ');
while (p && *++p)
*p = '*';
}
LOG3((" %s\n", buf.get()));
lines = p + 2;
lineStart = endOfLine + 2;
}
}
#endif
Expand Down

0 comments on commit 59142e1

Please sign in to comment.