core: check that string is not NULL in function string_iconv

v2.8-utf8proc
Sébastien Helleu 2014-07-27 08:34:34 +02:00
parent 7710084ba8
commit 12c8cd4988
1 changed files with 5 additions and 0 deletions

View File

@ -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))
{