mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fix bug #65873 - Integer overflow in exif_read_data()
This commit is contained in:
parent
68a73ce3c4
commit
cbcf6e1880
2 changed files with 9 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -17,6 +17,9 @@ PHP NEWS
|
|||
. Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML()
|
||||
Produces invalid Markup). (Mike)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #66229 (128.0.0.0/16 isn't reserved any longer). (Adam)
|
||||
|
||||
|
|
|
@ -2852,7 +2852,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
|
|||
offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel);
|
||||
/* If its bigger than 4 bytes, the dir entry contains an offset. */
|
||||
value_ptr = offset_base+offset_val;
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) {
|
||||
/*
|
||||
dir_entry is ImageInfo->file.list[sn].data+2+i*12
|
||||
offset_base is ImageInfo->file.list[sn].data-dir_offset
|
||||
dir_entry - offset_base is dir_offset+2+i*12
|
||||
*/
|
||||
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
|
||||
/* It is important to check for IMAGE_FILETYPE_TIFF
|
||||
* JPEG does not use absolute pointers instead its pointers are
|
||||
* relative to the start of the TIFF header in APP1 section. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue