From 5285ae1de367013bf70a5a4e5feaefe3de8dda7b Mon Sep 17 00:00:00 2001 From: glennrp Date: Wed, 31 Dec 2014 17:38:12 +0000 Subject: [PATCH] Avoid reading beyond the end of tEXt keyword while checking for Raw profile. --- coders/png.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.50.1