forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix EXIF bugs where corrupted exif blocks could overrun memory (Acade…
…mySoftwareFoundation#3627) In one case, we actually had a check for this, but an assignment to an int made the nonsensical offset appear negative, and we only tested whether the necessary offset it was bigger than the buffer size. Keeping it as (unsigned) size_t makes the test work as intended. In another case, there were several places where we never checked that we were staying within the exif block, and here we address this by changing the utility decode_ifd so instead of passing it a pointer to the ifd, it passes the offset (the pointer turned out to always be inside the buffer) so it can check the extent for subsequent accesses. Also some fixes related to squashing undefined behavior sanitizer cases.
- Loading branch information
Showing
11 changed files
with
89 additions
and
33 deletions.
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
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
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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/usr/bin/env python | ||
|
||
failureok = 1 | ||
redirect = ' >> out.txt 2>&1 ' | ||
|
||
# This file has a corrupted Exif block in the metadata. It used to | ||
# crash on some platforms, on others would be caught by address sanitizer. | ||
# Fixed by #1635. This test serves to guard against regressions. | ||
command += info_command ("src/corrupt-exif.jpg", safematch=True) | ||
|
||
# Checking the error output is important for this test | ||
outputs = [ "out.txt" ] | ||
failureok = 1 | ||
# This file has a corrupted Exif block that makes it look like one item has a | ||
# nonsensical length, that before being fixed, caused a buffer overrun. | ||
command += info_command ("src/corrupt-exif-1626.jpg", safematch=True) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Binary file not shown.
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