From 67d92d90f828ba5eabcf208c7876063dd50636bf Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Wed, 14 Aug 2013 05:11:36 +0000 Subject: [PATCH] ensure return after memory allocation failure (#2449, CVS-2013-4232) --- ChangeLog | 5 +++++ tools/tiff2pdf.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a6c779c..449555d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-13 Frank Warmerdam + + * tools/tiff2pdf.c: terminate after failure of allocating + ycbcr buffer (bug #2449, CVE-2013-4232) + 2013-07-09 Frank Warmerdam * tools/tiffinfo.c: Default various values fetched with diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c index 109f618b..951f44b5 100644 --- a/tools/tiff2pdf.c +++ b/tools/tiff2pdf.c @@ -1,4 +1,4 @@ -/* $Id: tiff2pdf.c,v 1.71 2013-05-02 14:54:08 tgl Exp $ +/* $Id: tiff2pdf.c,v 1.72 2013-08-14 05:11:37 fwarmerdam Exp $ * * tiff2pdf - converts a TIFF image to a PDF document * @@ -2461,7 +2461,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){ (unsigned long) t2p->tiff_datasize, TIFFFileName(input)); t2p->t2p_error = T2P_ERR_ERROR; - _TIFFfree(buffer); + _TIFFfree(buffer); + return(0); } else { buffer=samplebuffer; t2p->tiff_datasize *= t2p->tiff_samplesperpixel;