Fixes Coverity CID 710867: Dereference before null check (REVERSE_INULL)
Dereferencing pointer "text". (The dereference is assumed on the basis of the 'nonnull' parameter attribute.)
312 size_t inbuf_n = strlen( text );
...
Dereferencing "text" before a null check.
319 if ( text != NULL && strcmp( text, "" ) && iconv( cd, &inbuf_p, &inbuf_n, &outbuf_p, &outbuf_n ) != -1 )
int result = -1;
iconv_t cd = iconv_open( "UTF-8", encoding );
- if ( cd != ( iconv_t )-1 )
+ if ( text && ( cd != ( iconv_t )-1 ) )
{
char *inbuf_p = text;
size_t inbuf_n = strlen( text );