summaryrefslogtreecommitdiff
path: root/pngrutil.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-09-18 14:23:41 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2017-09-18 14:23:41 -0500
commit721b96ef902112c6d41db119ccc3129156714628 (patch)
tree78b5fc9013ba63a383e538543192f19e11d35b61 /pngrutil.c
parent562a68513e1bc14c1d181a58dd305bb354780709 (diff)
downloadlibpng-721b96ef902112c6d41db119ccc3129156714628.tar.gz
[libpng16] zero out memory allocated by png_inflate
Diffstat (limited to 'pngrutil.c')
-rw-r--r--pngrutil.c4
1 files changed, 4 insertions, 0 deletions
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)
{