segmentation fault caused by empty application/pgp-signature part

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jul 19 08:02:24 PDT 2013


On 07/19/2013 08:10 AM, David Bremner wrote:
> 
> The attached message is edited from one I managed to convince notmuch-emacs to
> send via some mishap with gpg-agent. It has an empty signature
> part. Clearly this is wrong, but on the other hand, it should not cause
> notmuch show --decrypt to segmentation fault. As for the actual creation
> of the message, I suppose that's more likely a bug in emacs, if
> anything.

confirmed the bug in notmuch.

here is the backtrace:

>> Program received signal SIGSEGV, Segmentation fault.
>> __strcasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164
>> 164	../sysdeps/x86_64/multiarch/strcmp-sse42.S: No such file or directory.
>> (gdb) bt
>> #0  __strcasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:164
>> #1  0x0000000000412973 in notmuch_crypto_get_context (crypto=0x7fffffffe248, protocol=0x0) at crypto.c:36
>> #2  0x00000000004123a9 in _mime_node_create (part=0x6dc180, parent=0x66a5a0) at mime-node.c:190
>> #3  mime_node_child (parent=parent at entry=0x66a5a0, child=child at entry=0) at mime-node.c:310
>> #4  0x000000000040f3ef in format_part_text (ctx=<optimized out>, sp=0x6695a0, node=0x66a5a0, indent=0, params=0x7fffffffe230) at notmuch-show.c:592
>> #5  0x000000000040eda9 in show_message (ctx=ctx at entry=0x6280f0, sp=sp at entry=0x6695a0, message=message at entry=0x6697c0, indent=indent at entry=0, params=params at entry=0x7fffffffe230, format=0x61bd30 <format_text>)
>>     at notmuch-show.c:905
>> #6  0x000000000040ee15 in show_messages (ctx=ctx at entry=0x6280f0, format=format at entry=0x61bd30 <format_text>, sp=sp at entry=0x6695a0, messages=0x66a3a0, indent=indent at entry=0, params=params at entry=0x7fffffffe230)
>>     at notmuch-show.c:941
>> #7  0x0000000000410955 in do_show (params=0x7fffffffe230, sp=0x6695a0, format=0x61bd30 <format_text>, query=0x643a20, ctx=0x6280f0) at notmuch-show.c:1024
>> #8  notmuch_show_command (ctx=0x6280f0, argc=<optimized out>, argv=<optimized out>) at notmuch-show.c:1228
>> #9  0x000000000040691c in main (argc=4, argv=0x7fffffffe6a8) at notmuch.c:329
>> (gdb) up
>> #1  0x0000000000412973 in notmuch_crypto_get_context (crypto=0x7fffffffe248, protocol=0x0) at crypto.c:36
>> 36	    if ((strcasecmp (protocol, "application/pgp-signature") == 0)
>> (gdb) p protocol
>> $1 = 0x0
>> (gdb) 

Looks like it's a pretty obvious fix -- test protocol for NULL before
strcasecmp'ing it.  sorry i don't have time to fix it right now.

	--dkg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1027 bytes
Desc: OpenPGP digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20130719/410c8b58/attachment-0001.pgp>


More information about the notmuch mailing list