]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Be more cautious about parsing ISO-9660 timestamps (#2340)
authorMartin Matuška <martin@matuska.org>
Sun, 22 Sep 2024 23:03:39 +0000 (01:03 +0200)
committerGitHub <noreply@github.com>
Sun, 22 Sep 2024 23:03:39 +0000 (01:03 +0200)
commit4aed70b797fcc1b1d45e9b7d3d8f5ff15754def0
tree1c877c7c08a74e97d78f5122d2b161a1972cf3ee
parent12ecf8418ab3595d66cdea1abadcea8b6a9d288b
Be more cautious about parsing ISO-9660 timestamps (#2340)

Some ISO images don't have valid timestamps for the root directory
entry. Parsing such timestamps can generate nonsensical results, which
in one case showed up as an unexpected overflow on a 32-bit system.

Add some validation logic that can check whether a 7-byte or 17-byte
timestamp is reasonable-looking, and use this to ignore invalid
timestamps in various locations. This also requires us to be a little
more careful about tracking which timestamps are actually known.

Resolves issue #2329

(cherry picked from commit e939c97a579131aa021166ef5876b303bccd8472)

Co-authored-by: Tim Kientzle <kientzle@acm.org>
libarchive/archive_read_support_format_iso9660.c
libarchive/test/test_read_format_iso_Z.c