mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fix bug #78793
This commit is contained in:
parent
d348cfb96f
commit
c14eb8de97
@ -3240,8 +3240,9 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (de=0;de<NumDirEntries;de++) {
|
for (de=0;de<NumDirEntries;de++) {
|
||||||
if (!exif_process_IFD_TAG(ImageInfo, dir_start + 2 + 12 * de,
|
size_t offset = 2 + 12 * de;
|
||||||
offset_base, data_len, displacement, section_index, 0, maker_note->tag_table)) {
|
if (!exif_process_IFD_TAG(ImageInfo, dir_start + offset,
|
||||||
|
offset_base, data_len - offset, displacement, section_index, 0, maker_note->tag_table)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
ext/exif/tests/bug78793.phpt
Normal file
12
ext/exif/tests/bug78793.phpt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--TEST--
|
||||||
|
Bug #78793: Use-after-free in exif parsing under memory sanitizer
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$f = "ext/exif/tests/bug77950.tiff";
|
||||||
|
for ($i = 0; $i < 10; $i++) {
|
||||||
|
@exif_read_data($f);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
===DONE===
|
||||||
|
--EXPECT--
|
||||||
|
===DONE===
|
Loading…
Reference in New Issue
Block a user