зеркало из https://github.com/mozilla/pjs.git
fixed bug 57059 -- buffer overrun on message header, r=ducarroz, rhp, sr=mscott
This commit is contained in:
Родитель
d727525453
Коммит
bed2824538
|
@ -36,10 +36,10 @@
|
|||
[scriptable, uuid(13E16676-6648-11d3-A72F-0060B0EB39B5)]
|
||||
interface nsIMimeHeaders : nsISupports {
|
||||
|
||||
void initialize([const] in string allHeaders);
|
||||
void initialize([const] in string allHeaders, in long allHeadersSize);
|
||||
string extractHeader ([const] in string headerName, in boolean getAllOfThem);
|
||||
};
|
||||
|
||||
%{C++
|
||||
nsresult NS_NewMimeHeaders(const nsIID &aIID, void ** aInstancePtrResult);
|
||||
%}
|
||||
%}
|
||||
|
|
|
@ -39,7 +39,7 @@ nsMimeHeaders::~nsMimeHeaders()
|
|||
|
||||
NS_IMPL_ISUPPORTS(nsMimeHeaders, NS_GET_IID(nsIMimeHeaders))
|
||||
|
||||
nsresult nsMimeHeaders::Initialize(const char * aAllHeaders)
|
||||
nsresult nsMimeHeaders::Initialize(const char * aAllHeaders, PRInt32 allHeadersSize)
|
||||
{
|
||||
/* just in case we want to reuse the object, cleanup...*/
|
||||
if (mHeaders)
|
||||
|
@ -47,7 +47,7 @@ nsresult nsMimeHeaders::Initialize(const char * aAllHeaders)
|
|||
|
||||
mHeaders = MimeHeaders_new();
|
||||
if (mHeaders)
|
||||
return MimeHeaders_parse_line(aAllHeaders, nsCRT::strlen(aAllHeaders), mHeaders);
|
||||
return MimeHeaders_parse_line(aAllHeaders, allHeadersSize, mHeaders);
|
||||
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -60,3 +60,4 @@ nsresult nsMimeHeaders::ExtractHeader(const char *headerName, PRBool getAllOfThe
|
|||
*_retval = MimeHeaders_get(mHeaders, headerName, PR_FALSE, getAllOfThem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -939,7 +939,7 @@ nsStreamConverter::OnStopRequest(nsIChannel * aChannel, nsISupports *ctxt, nsres
|
|||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
if (*workHeaders)
|
||||
mimeHeaders->Initialize((*workHeaders)->all_headers);
|
||||
mimeHeaders->Initialize((*workHeaders)->all_headers, (*workHeaders)->all_headers_fp);
|
||||
mMimeStreamConverterListener->OnHeadersReady(mimeHeaders);
|
||||
}
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче