Comment 9 for bug 554367

Revision history for this message
EliotBlennerhassett (eliot-blennerhassett) wrote :

More debug info. I built debug version of evolution-data-server from source.
cd evolution-data-server-2.28.3.1
DEB_BUILD_OPTIONS=nostrip,noopt dpkg-buildpackage -rfakeroot -uc -us
dpkg -i

camel-imap-utils.c line 715
imap_parse_string_generic(&str_p,...) (and therefore imap_parse_string()) can set str_p to NULL!

This is called from imap_body_decode(), where it returns NULL AND sets inptr to NULL
Then, a little further on at line 928, inptr is dereferenced :(

line 918
  if (g_ascii_strncasecmp (inptr, "nil", 3) != 0) {
   subtype = imap_parse_string (&inptr, &len);
  } else {
   subtype = NULL;
   inptr += 3;
  }

  ctype = camel_content_type_new ("multipart", subtype ? subtype : "mixed");
  g_free (subtype);

line 928:
  if (*inptr++ != ')') {
   camel_content_type_unref (ctype);
   return NULL;
  }

So, I can see there is a bug, just guessing here...
every other call to imap_parse_string() is followed by
 if (inptr == NULL)
  return NULL;

Maybe adding it to this one will fix the issue.
...
Works for me!