From 12c8cd49882c8cdb684f782f9e8e18125fef0d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 27 Jul 2014 08:34:34 +0200 Subject: [PATCH] core: check that string is not NULL in function string_iconv --- src/core/wee-string.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/wee-string.c b/src/core/wee-string.c index b6ee3ee40..e29340298 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -2066,7 +2066,12 @@ string_iconv (int from_utf8, const char *from_code, const char *to_code, char *ptr_inbuf_shift; int done; size_t err, inbytesleft, outbytesleft; +#endif + if (!string) + return NULL; + +#ifdef HAVE_ICONV if (from_code && from_code[0] && to_code && to_code[0] && (string_strcasecmp(from_code, to_code) != 0)) {