From: Dirk Lemstra Date: Sun, 14 Jan 2018 00:20:15 +0000 (+0100) Subject: Added ResetMagickMemory to fix reading from initialized memory. X-Git-Tag: 7.0.7-22~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e5ba050e85b4e1924577a7d21f9d7820deaec5a;p=imagemagick Added ResetMagickMemory to fix reading from initialized memory. Credit to OSS-Fuzz --- diff --git a/coders/gif.c b/coders/gif.c index 0ee58a1b4..a778a142d 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -227,6 +227,10 @@ static LZWInfo *AcquireLZWInfo(Image *image,const size_t data_size) lzw_info=RelinquishLZWInfo(lzw_info); return((LZWInfo *) NULL); } + (void) ResetMagickMemory(lzw_info->table[0],0,MaximumLZWCode* + sizeof(**lzw_info->table)); + (void) ResetMagickMemory(lzw_info->table[1],0,MaximumLZWCode* + sizeof(**lzw_info->table)); for (i=0; i <= (ssize_t) lzw_info->maximum_data_value; i++) { lzw_info->table[0][i]=0;