From 721b96ef902112c6d41db119ccc3129156714628 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 18 Sep 2017 14:23:41 -0500 Subject: [PATCH] [libpng16] zero out memory allocated by png_inflate --- pngrutil.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pngrutil.c b/pngrutil.c index 9dc8825f1..95e2b81c8 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -670,6 +670,10 @@ png_decompress_chunk(png_structrp png_ptr, (terminate != 0); png_bytep text = png_voidcast(png_bytep, png_malloc_base(png_ptr, buffer_size)); + /* attempt to stop an oss-fuzz "use of uninitialized value" + * in png_set_text_2() + */ + memset(text, 0, buffer_size); if (text != NULL) {