mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Fix for bug #55074 - sr: mscott - Crash recurising in CountTotalMimeAttachments
This commit is contained in:
parent
4174a19961
commit
3d941fde1e
@ -294,7 +294,7 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
obj->options->write_html_p)
|
||||
{
|
||||
PRBool all_headers_p = obj->options->headers == MimeHeadersAll;
|
||||
MimeDisplayOptions newopt = *obj->options; /* copy it */
|
||||
MimeDisplayOptions *newopt = obj->options; /* copy it */
|
||||
|
||||
char *ct = MimeHeaders_get(obj->headers, HEADER_CONTENT_TYPE,
|
||||
PR_FALSE, PR_FALSE);
|
||||
@ -428,8 +428,8 @@ MimeExternalBody_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||
}
|
||||
}
|
||||
|
||||
newopt.fancy_headers_p = PR_TRUE;
|
||||
newopt.headers = (all_headers_p ? MimeHeadersAll : MimeHeadersSome);
|
||||
newopt->fancy_headers_p = PR_TRUE;
|
||||
newopt->headers = (all_headers_p ? MimeHeadersAll : MimeHeadersSome);
|
||||
|
||||
FAIL:
|
||||
if (hdrs)
|
||||
|
@ -71,6 +71,8 @@
|
||||
#include "nsIURI.h"
|
||||
#include "nsIMsgWindow.h"
|
||||
|
||||
#include "mimeebod.h"
|
||||
|
||||
static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID);
|
||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
@ -204,6 +206,9 @@ CountTotalMimeAttachments(MimeContainer *aObj)
|
||||
if ( (!aObj) || (!aObj->children) || (aObj->nchildren <= 0) )
|
||||
return 0;
|
||||
|
||||
if (mime_typep((MimeObject *)aObj, (MimeObjectClass *)&mimeExternalBodyClass))
|
||||
return 0;
|
||||
|
||||
for (i=0; i<aObj->nchildren; i++)
|
||||
rc += CountTotalMimeAttachments((MimeContainer *)aObj->children[i]) + 1;
|
||||
|
||||
@ -287,7 +292,8 @@ BuildAttachmentList(MimeObject *aChild, nsMsgAttachmentData *aAttachData,
|
||||
PRBool isAlternativeOrRelated;
|
||||
PRBool isIMAPPart = PR_FALSE;
|
||||
|
||||
if ( (!aChild) || (!cobj->children) )
|
||||
if ( (!aChild) || (!cobj->children) ||
|
||||
(mime_typep(aChild, (MimeObjectClass *)&mimeExternalBodyClass)))
|
||||
return NS_OK;
|
||||
|
||||
if (MimeObjectChildIsMessageBody(aChild, &isAlternativeOrRelated))
|
||||
|
Loading…
x
Reference in New Issue
Block a user