diff --git a/ChangeLog b/ChangeLog index 5296cc23..ca4cdcf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-09 Frank Warmerdam + + * libtiff/tif_dirread.c: Improve allocation safety when allocated + buffer for large tags. (#1998) Related to (#1993) + 2009-02-06 Frank Warmerdam * tools/tiffcrop.c: Don't default image->res_unit to INCH. Now the diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index 7d2b4fb2..6dac1656 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.152 2009-02-05 20:13:44 fwarmerdam Exp $ */ +/* $Id: tif_dirread.c,v 1.153 2009-02-09 14:29:08 fwarmerdam Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -780,7 +780,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* d *count=(uint32)direntry->tdir_count; datasize=(*count)*typesize; assert((tmsize_t)datasize>0); - data=_TIFFmalloc(datasize); + data=_TIFFCheckMalloc(tif, *count, typesize, "ReadDirEntryArray"); if (data==0) return(TIFFReadDirEntryErrAlloc); if (!(tif->tif_flags&TIFF_BIGTIFF))