improve tag buffer allocation safety (#1998)
This commit is contained in:
parent
5d40e67e89
commit
a62c54d6f8
@ -1,3 +1,8 @@
|
|||||||
|
2009-02-09 Frank Warmerdam <warmerdam@pobox.com>
|
||||||
|
|
||||||
|
* libtiff/tif_dirread.c: Improve allocation safety when allocated
|
||||||
|
buffer for large tags. (#1998) Related to (#1993)
|
||||||
|
|
||||||
2009-02-06 Frank Warmerdam <warmerdam@pobox.com>
|
2009-02-06 Frank Warmerdam <warmerdam@pobox.com>
|
||||||
|
|
||||||
* tools/tiffcrop.c: Don't default image->res_unit to INCH. Now the
|
* tools/tiffcrop.c: Don't default image->res_unit to INCH. Now the
|
||||||
|
@ -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
|
* Copyright (c) 1988-1997 Sam Leffler
|
||||||
@ -780,7 +780,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* d
|
|||||||
*count=(uint32)direntry->tdir_count;
|
*count=(uint32)direntry->tdir_count;
|
||||||
datasize=(*count)*typesize;
|
datasize=(*count)*typesize;
|
||||||
assert((tmsize_t)datasize>0);
|
assert((tmsize_t)datasize>0);
|
||||||
data=_TIFFmalloc(datasize);
|
data=_TIFFCheckMalloc(tif, *count, typesize, "ReadDirEntryArray");
|
||||||
if (data==0)
|
if (data==0)
|
||||||
return(TIFFReadDirEntryErrAlloc);
|
return(TIFFReadDirEntryErrAlloc);
|
||||||
if (!(tif->tif_flags&TIFF_BIGTIFF))
|
if (!(tif->tif_flags&TIFF_BIGTIFF))
|
||||||
|
Loading…
Reference in New Issue
Block a user