]> git.notmuchmail.org Git - notmuch/commit - lib/index.cc
Do not segfault on empty mime parts
authormartin f. krafft <madduck@madduck.net>
Tue, 2 Mar 2010 15:31:28 +0000 (16:31 +0100)
committerCarl Worth <cworth@cworth.org>
Tue, 13 Apr 2010 15:49:06 +0000 (08:49 -0700)
commit449a418c65fb1f9281f761aae23576900d0d3ef1
tree4df019996e6e8555381a15c59ce5804a2a022b9e
parent423421526329f9c788e707301ee966eea911d261
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>
lib/index.cc