unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: notmuch <notmuch@notmuchmail.org>
Subject: Re: segmentation fault caused by empty application/pgp-signature part
Date: Fri, 19 Jul 2013 11:02:24 -0400	[thread overview]
Message-ID: <51E95500.8000404@fifthhorseman.net> (raw)
In-Reply-To: <87mwpiu4vi.fsf@zancas.localnet>

[-- Attachment #1: Type: text/plain, Size: 2481 bytes --]

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@entry=0x66a5a0, child=child@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@entry=0x6280f0, sp=sp@entry=0x6695a0, message=message@entry=0x6697c0, indent=indent@entry=0, params=params@entry=0x7fffffffe230, format=0x61bd30 <format_text>)
>>     at notmuch-show.c:905
>> #6  0x000000000040ee15 in show_messages (ctx=ctx@entry=0x6280f0, format=format@entry=0x61bd30 <format_text>, sp=sp@entry=0x6695a0, messages=0x66a3a0, indent=indent@entry=0, params=params@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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 1027 bytes --]

  reply	other threads:[~2013-07-19 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 12:10 segmentation fault caused by empty application/pgp-signature part David Bremner
2013-07-19 15:02 ` Daniel Kahn Gillmor [this message]
2013-07-19 15:57   ` Jameson Graef Rollins
2013-07-19 17:32     ` Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E95500.8000404@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).