]> git.cworth.org Git - notmuch/commit
sprinters: bugfix when NULL passed for a string.
authorMark Walters <markwalters1009@gmail.com>
Wed, 8 Aug 2012 21:23:33 +0000 (22:23 +0100)
committerDavid Bremner <bremner@debian.org>
Sun, 12 Aug 2012 19:25:01 +0000 (21:25 +0200)
commit94c3b40d41f1ad98719d411ef28b69075fda0579
tree626dd70f0fc46947595312aae8c62e1320d6bf68
parent36e640852b240ad10daed626391e1b812df89200
sprinters: bugfix when NULL passed for a string.

The string function in a sprinter may be called with a NULL string
pointer (eg if a header is absent). This causes a segfault. We fix
this by checking for a null pointer in the string functions and update
the sprinter documentation.

At the moment some output when format=text is done directly rather than
via an sprinter: in that case a null pointer is passed to printf or
similar and a "(null)" appears in the output. That behaviour is not
changed in this patch.
sprinter-json.c
sprinter-text.c
sprinter.h
test/missing-headers