From 26e705bd56f11c66bdd27cabf925834fe20714ac Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Tue, 7 Aug 2001 01:23:54 +0000 Subject: [PATCH] fixes bug 83465 "response with empty content-type opens helper dialog (telocity dsl modem/router)" r=bbaetz, sr=mscott git-svn-id: svn://10.0.0.236/trunk@100451 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/http/src/nsHttpResponseHead.cpp | 9 ++++++--- .../netwerk/streamconv/converters/nsMultiMixedConv.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mozilla/netwerk/protocol/http/src/nsHttpResponseHead.cpp b/mozilla/netwerk/protocol/http/src/nsHttpResponseHead.cpp index 0ed5b61f596..943b82f8b39 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpResponseHead.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpResponseHead.cpp @@ -493,12 +493,15 @@ nsHttpResponseHead::ParseVersion(const char *str) nsresult nsHttpResponseHead::ParseContentType(char *type) { - char *p = PL_strchr(type, '('); - LOG(("nsHttpResponseHead::ParseContentType [type=%s]\n", type)); + // don't bother with an empty content-type header - bug 83465 + if (!*type) + return NS_OK; + + // we don't care about comments (although they are invalid here) + char *p = PL_strchr(type, '('); if (p) - // we don't care about comments (although they are invalid here) *p = 0; // check if the content-type has additional fields... diff --git a/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp b/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp index 59b72479785..eb6f60de69b 100644 --- a/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp +++ b/mozilla/netwerk/streamconv/converters/nsMultiMixedConv.cpp @@ -912,10 +912,13 @@ nsMultiMixedConv::ParseHeaders(nsIChannel *aChannel, char *&aPtr, nsresult nsMultiMixedConv::ParseContentType(char *type) { - char *p = PL_strchr(type, '('); + // don't bother with an empty content-type header - bug 83465 + if (!*type) + return NS_OK; + // we don't care about comments (although they are invalid here) + char *p = PL_strchr(type, '('); if (p) - // we don't care about comments (although they are invalid here) *p = 0; // check if the content-type has additional fields...