]> git.ipfire.org Git - thirdparty/tar.git/commit
Avoid overrun when converting ns-resolution timestamps to text
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Aug 2025 00:14:13 +0000 (17:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 19 Aug 2025 00:14:49 +0000 (17:14 -0700)
commitca02de4050357850a94f9208f81e00f15d105182
tree4c29aa70f0fc912a9bc2d38d6cfeba2d8d42cbc6
parentea7cfcba77eb102a48001224f8cf3d4de3295a2f
Avoid overrun when converting ns-resolution timestamps to text

Caught by gcc -fsanitize=address.
Inspired by Matthias Andree’s bug report in:
https://lists.gnu.org/r/bug-tar/2025-08/msg00019.html
though I found this bug via a simple "make check"
with sanitization enabled.
* src/common.h (TIMESPEC_STRSIZE_BOUND):
Make room for leading '-', needed in addition to the '-' room
supplied by SYSINT_BUFSIZE due to the way code_timespec works.
src/common.h