[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)
authorSeth Michael Larson <seth@python.org>
Wed, 4 Sep 2024 15:46:01 +0000 (10:46 -0500)
committerSean Whitton <spwhitton@spwhitton.name>
Thu, 20 Mar 2025 02:07:39 +0000 (10:07 +0800)
commit8bbdd31d6f196bb421313477f4d37ba012436be9
treea45021a69aa6ac61dfb0de0ed2cbc4bc1ba8a35e
parenta9473b21706b0fbed95ff4ab83e19f92de4e3dce
[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d088dd7ccc321f6103d23153256caa5d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0022-3.9-gh-121285-Remove-backtracking-when-parsing-tarfi.patch
Lib/tarfile.py
Lib/test/test_tarfile.py