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...