From: Adam Dickmeiss Date: Mon, 9 Jun 2008 15:07:14 +0000 (+0200) Subject: Allow NULL inp(ut) for utf8 decoder X-Git-Tag: v3.0.32~5 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0a1043fe4b7f9e22e7481dc9d81a0a8ca2092292;p=yaz-moved-to-github.git Allow NULL inp(ut) for utf8 decoder --- diff --git a/src/utf8.c b/src/utf8.c index bf92cd3..8c28d3a 100644 --- a/src/utf8.c +++ b/src/utf8.c @@ -22,7 +22,7 @@ static size_t init_utf8(yaz_iconv_t cd, yaz_iconv_decoder_t d, unsigned char *inp, size_t inbytesleft, size_t *no_read) { - if (inp[0] != 0xef) + if (!inp || inp[0] != 0xef) { *no_read = 0; return 0;