summaryrefslogtreecommitdiff
path: root/ext/exif
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-12-25 23:43:10 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-12-25 23:43:10 +0000
commite2c110bebf1f1a4089a37060714282fabf35d958 (patch)
tree8ff4c5361016cabf28af9435fba924cc3618015d /ext/exif
parent32d078f8e75842430f0bd2809693b467283fcd95 (diff)
downloadphp-git-e2c110bebf1f1a4089a37060714282fabf35d958.tar.gz
Allocation safety checks
Diffstat (limited to 'ext/exif')
-rw-r--r--ext/exif/exif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 0ae6c64eb6..397046d75d 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3590,7 +3590,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
#endif
if (!ImageInfo->Thumbnail.data) {
- ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
+ ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {
@@ -3623,7 +3623,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "%s THUMBNAIL @0x%04X + 0x%04X", ImageInfo->Thumbnail.data ? "Ignore" : "Read", ImageInfo->Thumbnail.offset, ImageInfo->Thumbnail.size);
#endif
if (!ImageInfo->Thumbnail.data && ImageInfo->Thumbnail.offset && ImageInfo->Thumbnail.size && ImageInfo->read_thumbnail) {
- ImageInfo->Thumbnail.data = emalloc(ImageInfo->Thumbnail.size);
+ ImageInfo->Thumbnail.data = safe_emalloc(ImageInfo->Thumbnail.size, 1, 0);
php_stream_seek(ImageInfo->infile, ImageInfo->Thumbnail.offset, SEEK_SET);
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {