-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
The MakerNote is not necessarily null-terminated, so we must not use `strlen()` to avoid OOB reads. Instead `php_strnlen()` is the proper way to handle this.
- Loading branch information
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--TEST-- | ||
Bug #76130 (Heap Buffer Overflow (READ: 1786) in exif_iif_add_value) | ||
--DESCRIPTION-- | ||
This test is meant to exhibit memory issues with the `-m` option. Since a lot of | ||
notices and warnings are to be expected anyway, we suppress these, since the are | ||
not relevant for this test. | ||
--INI-- | ||
error_reporting=E_ALL & ~E_WARNING & ~E_NOTICE | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('exif')) die('skip exif extension not available'); | ||
?> | ||
--FILE-- | ||
<?php | ||
exif_read_data(__DIR__ . '/bug76130_1.jpg'); | ||
exif_read_data(__DIR__ . '/bug76130_2.jpg'); | ||
?> | ||
===DONE=== | ||
--EXPECT-- | ||
===DONE=== |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.