]> git.ipfire.org Git - thirdparty/tar.git/commit
Port short_read to UBSan
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 Jun 2025 07:20:52 +0000 (00:20 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 12 Jun 2025 07:21:48 +0000 (00:21 -0700)
commit7d96e820a52531097db23f38725e178a9f7d66b0
treea3d407ce6c2a9e4c5fe2496b2920294072a68a4a
parent7c4f8fb5792ab019afa12e2066ce3366755d4d00
Port short_read to UBSan

Problem reported by Kirill Furman in:
https://lists.gnu.org/r/bug-tar/2025-06/msg00002.html
* src/buffer.c (short_read): Use (char *) record_start,
instead of record_start->buffer, to avoid undefined behavior
accessing past end of buffer.  In practice the undefined
behavior is harmless unless running with -fsanitize=undefined
or a similarly-picky implementation.
THANKS
src/buffer.c