]> git.ipfire.org Git - thirdparty/libarchive.git/commit
[tar] Harden timestamp parsing
authorTim Kientzle <kientzle@acm.org>
Sat, 2 May 2026 20:58:45 +0000 (13:58 -0700)
committerTim Kientzle <kientzle@acm.org>
Sat, 2 May 2026 22:02:28 +0000 (15:02 -0700)
commitd1d37fcbd7f34cb2171a1d60a545142e0e3028ff
treebf0453db3bf0e48d64f5375960b04d7571235d7b
parent1cc5c21be243d6290a064d6fcdfbfb47c7f1a4d8
[tar] Harden timestamp parsing

Improves the parsing of timestamps in a couple of ways:

* Saturate when timestamps exceed the range of time_t.
  In particular, this provides more rational behavior on
  systems with 32-bit time_t.

* Validate the format of overlong pax timestamps.
  We previously failed to check that high-resolution
  timestamps had only digits in the fractional part.
  We now notice and ignore those with a warning.
Makefile.am
libarchive/archive_read_support_format_tar.c
libarchive/test/CMakeLists.txt
libarchive/test/test_read_format_tar_pax_timestamps.c [new file with mode: 0644]
libarchive/test/test_read_format_tar_pax_timestamps.tar.uu [new file with mode: 0644]
libarchive/test/test_read_format_tar_timestamp_overflow.c [new file with mode: 0644]
libarchive/test/test_read_format_tar_timestamp_overflow.tar.uu [new file with mode: 0644]