Fix crash when looking at msgs without content type
authorAndre Heinecke <aheinecke@intevation.de>
Fri, 4 May 2018 07:23:38 +0000 (09:23 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Fri, 4 May 2018 07:23:38 +0000 (09:23 +0200)
* src/mapihelp.cpp (change_message_class_ipm_note): Check
for ct before using it in string comparison.

--
The codepath is reached for temporary, discarded mails, e.g.
when a Reply All in the Inline editor is canceled through
Escape.

This fixes: dc48589b3d429d7d156c75b4e7bc784b140f40ce
GnuPG-Bug-Id: T3960

src/mapihelp.cpp

index 1be66b6..16e45eb 100644 (file)
@@ -1073,7 +1073,7 @@ change_message_class_ipm_note (LPMESSAGE message)
          decide.  */
       newvalue = get_msgcls_from_pgp_lines (message, &has_no_body);
 
-      if (!newvalue && has_no_body && !strcmp (ct, "multipart/mixed"))
+      if (!newvalue && has_no_body && ct && !strcmp (ct, "multipart/mixed"))
         {
           /* This is uncommon. But some Exchanges might break a PGP/MIME mail
              this way. Let's take a look at the attachments. Maybe it's