-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use vector::at() rather than operator[] (#1735)
* Regression test for #1706 * Use vector::at() rather than operator[]. * Print to stderr when exception is caught and EXIV2_DEBUG_MESSAGES is enabled. * Check that it prints "Bad value" for the date. (cherry picked from commit f4d3adb) # Conflicts: # src/value.cpp
- Loading branch information
1 parent
fe83c73
commit 3c81b18
Showing
6 changed files
with
80 additions
and
29 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from system_tests import CaseMeta, path | ||
|
||
|
||
class InvalidDateXMP(metaclass=CaseMeta): | ||
""" | ||
Regression test for the bug described in: | ||
https://github.com/Exiv2/exiv2/issues/1706 | ||
""" | ||
url = "https://github.com/Exiv2/exiv2/issues/1706" | ||
|
||
filename = path("$data_path/issue_1706_poc.exv") | ||
commands = ["$exiv2 -PE $filename"] | ||
|
||
stderr = [ | ||
"""Error: Directory Photo with 65280 entries considered invalid; not read. | ||
""" | ||
] | ||
retval = [0] | ||
|
||
def compare_stdout(self, i, command, got_stdout, expected_stdout): | ||
# Check that it printed "Bad value" for the date. | ||
self.assertRegex(got_stdout, "Exif.PentaxDng.Date\\s+Long\\s+1\\s+Bad value") |