--- /dev/null
+Return-Path: <jrollins@finestructure.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 EE653431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 18:36:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.29\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] 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 TrWIL-1YIXB1 for <notmuch@notmuchmail.org>;\r
+ Tue, 7 Aug 2012 18:36:29 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+ [131.215.239.19])\r
+ by olra.theworths.org (Postfix) with ESMTP id 45E38431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 7 Aug 2012 18:36:29 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+ by earth-doxen-postvirus (Postfix) with ESMTP id B5AC966E0105;\r
+ Tue, 7 Aug 2012 18:36:26 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (m70.ligo.caltech.edu [131.215.115.170])\r
+ (Authenticated sender: jrollins)\r
+ by earth-doxen-submit (Postfix) with ESMTP id CE49666E00B9;\r
+ Tue, 7 Aug 2012 18:36:22 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+ id AFE8D5CF; Tue, 7 Aug 2012 18:36:22 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Mark Walters <markwalters1009@gmail.com>,\r
+ Ben Gamari <bgamari.foss@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] sprinters: bugfix when NULL passed for a string.\r
+In-Reply-To: <874noe1o0r.fsf@qmul.ac.uk>\r
+References: <871ujjuu2z.fsf@gmail.com> <878vdrp4d9.fsf@qmul.ac.uk>\r
+ <874noe1o0r.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.13.2+137~ge34ed71 (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 07 Aug 2012 18:36:20 -0700\r
+Message-ID: <871ujijhbf.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+ micalg=pgp-sha256; protocol="application/pgp-signature"\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: Wed, 08 Aug 2012 01:36:30 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On Tue, Aug 07 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> The string function in a sprinter may be called with a NULL string\r
+> pointer (eg if a header is absent). This causes a segfault. We fix\r
+> this by checking for a null pointer in the string functions and update\r
+> the sprinter documentation.\r
+>\r
+> At the moment some output when format=3Dtext is done directly rather than\r
+> via an sprinter: in that case a null pointer is passed to printf or\r
+> similar and a "(null)" appears in the output. That behaviour is not\r
+> changed in this patch.\r
+> ---\r
+>\r
+> This could really do with some tests (it is the second time this type of\r
+> bug has occurred). To be considered as a message by notmuch new a file\r
+> needs at least one of a From: Subject: or To: header. Thus we should\r
+> have three messages each of which just contains that single header (and\r
+> nothing else) and check that search and show work as expected.=20\r
+\r
+Hey, Mark. Thanks for working on this.\r
+\r
+I was wondering if we should distinguish between the header being\r
+absent, and having a null value. It looks like the idea here is to\r
+output an empty string for the value in all of these cases. But should\r
+we output the field at all if the actual header isn't there? In other\r
+words, I can imagine three scenarios:\r
+\r
+Header: value\r
+Header: --> "Header": ""\r
+no header=20=20=20=20=20\r
+\r
+At the moment these would be output as:\r
+\r
+"Header": "value"\r
+"Header": ""\r
+"Header": ""\r
+\r
+Where as I could imagine we could instead do:\r
+\r
+"Header": "value"\r
+"Header": ""\r
+no output\r
+\r
+Maybe that would be too complicated or break the output spec to much?\r
+If it's too complicated to do the later, then I'm fine with this\r
+solution as is.\r
+\r
+I definitely agree we need tests for this.\r
+\r
+jamie.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+\r
+iQIcBAEBCAAGBQJQIcKUAAoJEO00zqvie6q8JuMP/3jjlDO/CwzfhiTwSnLdKg+4\r
+89bagfP5LFRvPxyPYCFzHeO2WYSgwYNNusc2RBlivz5eyEPjVUin78dfyw4rIBvl\r
+3pfTnDywJGkmtJ9Tber0E4bl5f3VSCD9jnh/DCJK0k8YAnmy64/0DbKHk8s4GDkq\r
+CvB4vHRRukl4Cd6nOIdNcgJwe8/I8U3bbJNLuoXNTSQ0K/jy/BVtpOwS7LAxnM1y\r
+rcRSlO386sKFSluWjnEBsp7CNbX8HNw+6OBpPNPcrvLDltiHr6peSN83/ILzU0rS\r
+SEMQ47DsYrTEYI0eoDYcOWy+pfi6inz6z3Nba+aCQWofw2Y82wlU5aDMsLLWeJAO\r
+DzMedETmVL4XuYR7mRSnV3QKGvBMUKtDD46V2/1nneGxJwV2vqsv1VsYpID4xAjM\r
+eXuoRfvAWw+XdM798+BwNwCPKhczy+M2lvGoFTC3gvyR29RiEe+/y7YoRF/MqbwV\r
+yvOHTjsDxVtDo0KekKs6ie4hd1f9NIDgA6TZPx4hNryVuESf7OcBQcX4MvjXIuFl\r
+ka2siDysnT4ye7sjTNIqdsrNTvUH26TPjSEVgk17R+rOjARt2pX0uhHq0R/3YgwF\r
+bJSIlzuESP1P/k5rjB4g988N6OgSOyJGm7AtU+XwgooneVoR35F9nfxng68sDgIl\r
+CgaY+RetIAyWxNgjWiDT\r
+=/pfS\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r