Re: segmentation fault caused by empty application/pgp-signature part
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 19 Jul 2013 15:02:24 +0000 (11:02 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:03 +0000 (09:56 -0800)
80/ff2123151d939ea003018f57d049d53cdaac06 [new file with mode: 0644]

diff --git a/80/ff2123151d939ea003018f57d049d53cdaac06 b/80/ff2123151d939ea003018f57d049d53cdaac06
new file mode 100644 (file)
index 0000000..68007b7
--- /dev/null
@@ -0,0 +1,147 @@
+Return-Path: <dkg@fifthhorseman.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C5E70431FD0\r
+       for <notmuch@notmuchmail.org>; Fri, 19 Jul 2013 08:02:38 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id V8oTszW7zJhz for <notmuch@notmuchmail.org>;\r
+       Fri, 19 Jul 2013 08:02:31 -0700 (PDT)\r
+Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2C754431FC2\r
+       for <notmuch@notmuchmail.org>; Fri, 19 Jul 2013 08:02:31 -0700 (PDT)\r
+Received: from [192.168.13.183] (lair.fifthhorseman.net [108.58.6.98])\r
+       by che.mayfirst.org (Postfix) with ESMTPSA id EDB51F984\r
+       for <notmuch@notmuchmail.org>; Fri, 19 Jul 2013 11:02:25 -0400 (EDT)\r
+Message-ID: <51E95500.8000404@fifthhorseman.net>\r
+Date: Fri, 19 Jul 2013 11:02:24 -0400\r
+From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
+User-Agent: Mozilla/5.0 (X11; Linux x86_64;\r
+       rv:17.0) Gecko/20130630 Icedove/17.0.7\r
+MIME-Version: 1.0\r
+To: notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: segmentation fault caused by empty application/pgp-signature part\r
+References: <87mwpiu4vi.fsf@zancas.localnet>\r
+In-Reply-To: <87mwpiu4vi.fsf@zancas.localnet>\r
+X-Enigmail-Version: 1.5.1\r
+Content-Type: multipart/signed; micalg=pgp-sha512;\r
+       protocol="application/pgp-signature";\r
+       boundary="----enig2RGQXRKUTMSJPIALSVVQV"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 19 Jul 2013 15:02:38 -0000\r
+\r
+This is an OpenPGP/MIME signed message (RFC 4880 and 3156)\r
+------enig2RGQXRKUTMSJPIALSVVQV\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On 07/19/2013 08:10 AM, David Bremner wrote:\r
+>=20\r
+> The attached message is edited from one I managed to convince notmuch-e=\r
+macs to\r
+> send via some mishap with gpg-agent. It has an empty signature\r
+> part. Clearly this is wrong, but on the other hand, it should not cause=\r
+\r
+> notmuch show --decrypt to segmentation fault. As for the actual creatio=\r
+n\r
+> of the message, I suppose that's more likely a bug in emacs, if\r
+> anything.\r
+\r
+confirmed the bug in notmuch.\r
+\r
+here is the backtrace:\r
+\r
+>> Program received signal SIGSEGV, Segmentation fault.\r
+>> __strcasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.S:16=\r
+4\r
+>> 164 ../sysdeps/x86_64/multiarch/strcmp-sse42.S: No such file or direct=\r
+ory.\r
+>> (gdb) bt\r
+>> #0  __strcasecmp_l_avx () at ../sysdeps/x86_64/multiarch/strcmp-sse42.=\r
+S:164\r
+>> #1  0x0000000000412973 in notmuch_crypto_get_context (crypto=3D0x7ffff=\r
+fffe248, protocol=3D0x0) at crypto.c:36\r
+>> #2  0x00000000004123a9 in _mime_node_create (part=3D0x6dc180, parent=3D=\r
+0x66a5a0) at mime-node.c:190\r
+>> #3  mime_node_child (parent=3Dparent@entry=3D0x66a5a0, child=3Dchild@e=\r
+ntry=3D0) at mime-node.c:310\r
+>> #4  0x000000000040f3ef in format_part_text (ctx=3D<optimized out>, sp=3D=\r
+0x6695a0, node=3D0x66a5a0, indent=3D0, params=3D0x7fffffffe230) at notmuc=\r
+h-show.c:592\r
+>> #5  0x000000000040eda9 in show_message (ctx=3Dctx@entry=3D0x6280f0, sp=\r
+=3Dsp@entry=3D0x6695a0, message=3Dmessage@entry=3D0x6697c0, indent=3Dinde=\r
+nt@entry=3D0, params=3Dparams@entry=3D0x7fffffffe230, format=3D0x61bd30 <=\r
+format_text>)\r
+>>     at notmuch-show.c:905\r
+>> #6  0x000000000040ee15 in show_messages (ctx=3Dctx@entry=3D0x6280f0, f=\r
+ormat=3Dformat@entry=3D0x61bd30 <format_text>, sp=3Dsp@entry=3D0x6695a0, =\r
+messages=3D0x66a3a0, indent=3Dindent@entry=3D0, params=3Dparams@entry=3D0=\r
+x7fffffffe230)\r
+>>     at notmuch-show.c:941\r
+>> #7  0x0000000000410955 in do_show (params=3D0x7fffffffe230, sp=3D0x669=\r
+5a0, format=3D0x61bd30 <format_text>, query=3D0x643a20, ctx=3D0x6280f0) a=\r
+t notmuch-show.c:1024\r
+>> #8  notmuch_show_command (ctx=3D0x6280f0, argc=3D<optimized out>, argv=\r
+=3D<optimized out>) at notmuch-show.c:1228\r
+>> #9  0x000000000040691c in main (argc=3D4, argv=3D0x7fffffffe6a8) at no=\r
+tmuch.c:329\r
+>> (gdb) up\r
+>> #1  0x0000000000412973 in notmuch_crypto_get_context (crypto=3D0x7ffff=\r
+fffe248, protocol=3D0x0) at crypto.c:36\r
+>> 36      if ((strcasecmp (protocol, "application/pgp-signature") =3D=3D =\r
+0)\r
+>> (gdb) p protocol\r
+>> $1 =3D 0x0\r
+>> (gdb)=20\r
+\r
+Looks like it's a pretty obvious fix -- test protocol for NULL before\r
+strcasecmp'ing it.  sorry i don't have time to fix it right now.\r
+\r
+       --dkg\r
+\r
+\r
+------enig2RGQXRKUTMSJPIALSVVQV\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+Content-Disposition: attachment; filename="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+Comment: Using GnuPG with Icedove - http://www.enigmail.net/\r
+\r
+iQJ8BAEBCgBmBQJR6VUAXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFQjk2OTEyODdBN0FEREUzNzU3RDkxMUVB\r
+NTI0MDFCMTFCRkRGQTVDAAoJEKUkAbEb/fpcon8P/Ri+tmMpvWV24YCgGWr+kaY0\r
+5sR7Ed1K7umaJwfzHwVwj9IC1uwk/aP6Tr4VD8m5t4Y8raSD82wGPWAPd8WIFFb/\r
+bOjFu1AuzyU633QPp8n7iF0g9M4iQJ+XfYtIQElq3T5x7/+Q1YVX8fw6fmt6wBTi\r
+pQxZSLHkF6VX2rqUKUgx9RoWaQDIV9OmSUCE4/Qf0PTV6beIp6vlUMdLbCf/AJ3f\r
+WQp14Yq5rFOt1HIspMIlnJJveuvAGRLX4HcJEJWk+IZOWg8hTOZHL6RURhr/yfb6\r
+kOQTpwLnx64/HltN5qHGGmMvma+bSsLUw9uEIs35mr2cVnBC9YAGrVLAAedFqFXK\r
+icYwSCypNdc4JN9Ei3kYD7xQQY1d8t1nCTwlIPzmjwR+yH9x+W04UyabpBqSMH9h\r
+4z6fJvvFmfLAB1FpSejFsZ607Mg4pCVQcwZLMQjvfxoY2G3kc1SnMINPTHITE7QR\r
+JCrFzZGETHwlHNwbjn4oBATBnwiM5q158Vit5UBJAZZl974OcuPGHYtXxYwMORyx\r
+8M3JJgixtZKehGoyME67xWmnaizkcwtYvDrw3fJWu1zgvzhoumVlI9FaUH4cVNK7\r
+rIVlAs0L/0jc1U2PXiCL0t4cltt6oyh2uCF6KHgfTXozuURu13srLubi+fa2d7Ix\r
+YQznhCqN0GY5Egt0RSpu\r
+=aKlX\r
+-----END PGP SIGNATURE-----\r
+\r
+------enig2RGQXRKUTMSJPIALSVVQV--\r