Allow NULL inp(ut) for utf8 decoder
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 9 Jun 2008 15:07:14 +0000 (17:07 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 9 Jun 2008 15:07:14 +0000 (17:07 +0200)
src/utf8.c

index bf92cd3..8c28d3a 100644 (file)
@@ -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;