From: glennrp Date: Wed, 31 Dec 2014 17:38:12 +0000 (+0000) Subject: Avoid reading beyond the end of tEXt keyword while checking for Raw profile. X-Git-Tag: 7.0.1-0~1512 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5285ae1de367013bf70a5a4e5feaefe3de8dda7b;p=imagemagick Avoid reading beyond the end of tEXt keyword while checking for Raw profile. --- diff --git a/coders/png.c b/coders/png.c index 9decb30ee..0c4aa719d 100644 --- a/coders/png.c +++ b/coders/png.c @@ -3604,7 +3604,8 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, (void) LogMagickEvent(CoderEvent,GetMagickModule(), " Reading PNG text chunk"); - if (memcmp(text[i].key, "Raw profile type ",17) == 0) + if (strlen(text[i].key) > 16 && + !memcmp(text[i].key, "Raw profile type ",17) == 0) { const char *value;