ENGINE-505: note that we still don't support malformed MIME, but we shouldn't crash. sync
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Mon, 15 Jul 2019 15:56:17 +0200
branchsync
changeset 3927fd89f666f4e4
parent 3924 a361d47fe7be
child 3930 dbd227c0fef8
child 3932 c487731d164d
ENGINE-505: note that we still don't support malformed MIME, but we shouldn't crash.
src/message_api.c
     1.1 --- a/src/message_api.c	Mon Jul 15 11:43:10 2019 +0200
     1.2 +++ b/src/message_api.c	Mon Jul 15 15:56:17 2019 +0200
     1.3 @@ -2604,8 +2604,8 @@
     1.4      
     1.5      if ((!slong || slong[0] == '\0')
     1.6           && (!sform || sform[0] == '\0')) {
     1.7 -        if (satt) {
     1.8 -            const char* inner_mime_type = satt->mime_type;
     1.9 +        const char* inner_mime_type = (satt ? satt->mime_type : NULL);     
    1.10 +        if (inner_mime_type) {
    1.11              if (strcasecmp(inner_mime_type, "text/plain") == 0) {
    1.12                  free(slong); /* in case of "" */
    1.13                  src->longmsg = strndup(satt->value, satt->size);