Skip to content

Commit c6315f8

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 0a6291b + 5e48bb7 commit c6315f8

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

ext/exif/exif.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,9 +3478,11 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
34783478
Subdir_start = offset_base + php_ifd_get32u(value_ptr, ImageInfo->motorola_intel);
34793479
if (Subdir_start < offset_base || Subdir_start > offset_base+IFDlength) {
34803480
exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD Pointer");
3481+
EFREE_IF(outside);
34813482
return FALSE;
34823483
}
34833484
if (!exif_process_IFD_in_JPEG(ImageInfo, Subdir_start, offset_base, IFDlength, displacement, sub_section_index, tag)) {
3485+
EFREE_IF(outside);
34843486
return FALSE;
34853487
}
34863488
#ifdef EXIF_DEBUG
46 Bytes
Loading
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
OSS-Fuzz: Temporary buffer leak in tag reading
3+
--FILE--
4+
<?php
5+
6+
var_dump(@exif_read_data(__DIR__ . '/temporary_buffer_leak.jpg'));
7+
8+
?>
9+
--EXPECT--
10+
bool(false)

0 commit comments

Comments
 (0)