Bug 1411734 - don't access receipt field from draft info if it's not there. r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 28 Oct 2017 00:12:06 +0200
changeset 29269 f24014af19e1acf0e4c21560fb1cb386344e8c90
parent 29268 98161291e20d4549da37d2a80608c4f70f3f8506
child 29270 93f59d94a828815499af0d953d7dd4f8b333bb14
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1411734
Bug 1411734 - don't access receipt field from draft info if it's not there. r=aceman
mailnews/mime/src/mimedrft.cpp
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1401,17 +1401,17 @@ mime_parse_stream_complete(nsMIMESession
     if (draftInfo && fields && !forward_inline)
     {
       char *parm = 0;
       parm = MimeHeaders_get_parameter(draftInfo, "vcard", NULL, NULL);
       fields->SetAttachVCard(parm && !strcmp(parm, "1"));
       PR_FREEIF(parm);
 
       parm = MimeHeaders_get_parameter(draftInfo, "receipt", NULL, NULL);
-      if (parm && !strcmp(parm, "0"))
+      if (!parm || !strcmp(parm, "0"))
         fields->SetReturnReceipt(false);
       else
       {
         int receiptType = 0;
         fields->SetReturnReceipt(true);
         sscanf(parm, "%d", &receiptType);
         // slight change compared to 4.x; we used to use receipt= to tell
         // whether the draft/template has request for either MDN or DNS or both