diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2006-12-26 17:33:13 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2006-12-26 17:33:13 +0000 |
| commit | 87b7293e4b526312c01ec5237887d4320d521882 (patch) | |
| tree | ca893e2144bd29e86698001f57a06b9968a5dfe6 /ext/exif/exif.c | |
| parent | f025e896df5ec9b22c7d846f0e60f286e6f346f5 (diff) | |
| download | php-git-87b7293e4b526312c01ec5237887d4320d521882.tar.gz | |
MFB: safety checks
Diffstat (limited to 'ext/exif/exif.c')
| -rw-r--r-- | ext/exif/exif.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 404d183bb7..0dfb5b0756 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3536,7 +3536,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse exif_error_docref(NULL TSRMLS_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) { @@ -3569,7 +3569,7 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse exif_error_docref(NULL TSRMLS_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) { |
