g_strcompress: check that source is non-NULL rather than just crashing
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Mon, 12 Dec 2011 18:37:10 +0000 (18:37 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 14 Dec 2011 12:26:17 +0000 (12:26 +0000)
commit0bf8378840ef553262fa4f8c981c867f8f6efaaf
tree4c5e1d81dcf4184c4c584a045f85c5e834e7c662
parentfbab468da531c41a516024171e67c2a7088979dd
g_strcompress: check that source is non-NULL rather than just crashing

Calling this function with a NULL argument is considered to be invalid,
but one of the regression tests does it anyway (to watch it crash), which
seems a good indication that it's expected to be somewhat common.
Let's check it rather than segfaulting.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
glib/gstrfuncs.c