From: Cristy Date: Sun, 28 Jan 2018 21:55:03 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5260 X-Git-Tag: 7.0.7-23~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9642fc7fc5574ff936d42126b8363e33346a62c3;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5260 --- diff --git a/MagickCore/token-private.h b/MagickCore/token-private.h index d83d90cb0..fc6b43322 100644 --- a/MagickCore/token-private.h +++ b/MagickCore/token-private.h @@ -118,19 +118,15 @@ static inline int GetNextUTFCode(const char *text,unsigned int *octets) { unicode&=utf_info[i].utf_mask; if (unicode < utf_info[i].utf_value) - { - errno=EILSEQ; - return(-1); - } + break; *octets=(unsigned int) (i+1); return(unicode); } c=(int) (*text++ ^ 0x80) & 0xff; if ((c & 0xc0) != 0) - { - errno=EILSEQ; - return(-1); - } + break; + if (unicode > 0x10FFFF) + break; unicode=(unicode << 6) | c; } errno=EILSEQ;