Skip to content

gh-159322: NUL-terminate owner names in PAX base headers - #159329

Open
esadomer wants to merge 3 commits into
python:mainfrom
esadomer:fix-20261013-01-tarfile-owner-names
Open

esadomer wants to merge 3 commits into
python:mainfrom
esadomer:fix-20261013-01-tarfile-owner-names

Conversation

@esadomer

@esadomer esadomer commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Owner and group names of 32 or more ASCII characters can fill the entire fixed-width field in a PAX base header. Reserve its last byte for a NUL terminator and retain the complete name in the extended header. Cover both fields at lengths 0, 31, 32, 33, and 40.

Fixes #159322.

Validation (Windows debug build): test_tarfile passed (786 tests run, 22 skipped); the new boundary cases failed before the fix. The isolated patch applies cleanly to the base revision.

Comment thread Lib/tarfile.py
@ethanfurman ethanfurman self-assigned this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tarfile produces invalid pax archives when a gname is exactly 32 bytes long

2 participants