mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
Do not segfault on empty mime parts
notmuch previously unconditionally checked mime parts for various properties, but not for NULL, which is the case if libgmime encounters an empty mime part. Upon encounter of an empty mime part, the following is printed to stderr (the second line due to my patch): (process:17197): gmime-CRITICAL **: g_mime_message_get_mime_part: assertion `GMIME_IS_MESSAGE (message)' failed Warning: Not indexing empty mime part. This is probably a bug that should get addressed in libgmime, but for not, my patch is an acceptable workaround. Signed-off-by: martin f. krafft <madduck@madduck.net>
This commit is contained in:
parent
4234215263
commit
449a418c65
1 changed files with 5 additions and 0 deletions
|
@ -336,6 +336,11 @@ _index_mime_part (notmuch_message_t *message,
|
|||
GMimeContentDisposition *disposition;
|
||||
char *body;
|
||||
|
||||
if (! part) {
|
||||
fprintf (stderr, "Warning: Not indexing empty mime part.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GMIME_IS_MULTIPART (part)) {
|
||||
GMimeMultipart *multipart = GMIME_MULTIPART (part);
|
||||
int i;
|
||||
|
|
Loading…
Reference in a new issue