Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ebdb558

Browse files
committed
Fix OSS-Fuzz #442954659: zero-size box in HEIF file causes infinite loop
If the box size is 0, the loop can't progress.
1 parent 4b99519 commit ebdb558

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
@@ -4426,6 +4426,8 @@ static bool exif_scan_HEIF_header(image_info_type *ImageInfo, unsigned char *buf
44264426
}
44274427
efree(data);
44284428
break;
4429+
} else if (box.size == 0) {
4430+
break;
44294431
}
44304432
}
44314433

‎ext/exif/tests/oss_fuzz_442954659/input

144 Bytes
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
OSS-Fuzz #442954659 (zero-size box in HEIF file causes infinite loop)
3+
--EXTENSIONS--
4+
exif
5+
--FILE--
6+
<?php
7+
exif_read_data(__DIR__."/input");
8+
?>
9+
--EXPECTF--
10+
Warning: exif_read_data(%s): Invalid HEIF file in %s on line %d

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /