This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: OverflowError in tarfile.open
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, ethan.furman, jvoisin
Priority: normal Keywords:

Created on 2019-12-13 15:57 by jvoisin, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
crash-83a6e7d4b810c6a0bd4fd9dfd6a0b36550034ccf jvoisin, 2019-12-13 15:57
Messages (2)
msg358336 - (view) Author: jvoisin (jvoisin) Date: 2019-12-13 15:57
The attached file produces the following stacktrace when opened via `tarfile.open`, on Python 3.7.5rc1:

```
$ cat test.py 
import sys
import tarfile

tarfile.open(sys.argv[1])
$ python3 test.py ./crash-83a6e7d4b810c6a0bd4fd9dfd6a0b36550034ccf
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    tarfile.open(sys.argv[1])
  File "/usr/lib/python3.7/tarfile.py", line 1573, in open
    return func(name, "r", fileobj, **kwargs)
  File "/usr/lib/python3.7/tarfile.py", line 1645, in gzopen
    t = cls.taropen(name, mode, fileobj, **kwargs)
  File "/usr/lib/python3.7/tarfile.py", line 1621, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/usr/lib/python3.7/tarfile.py", line 1484, in __init__
    self.firstmember = self.next()
  File "/usr/lib/python3.7/tarfile.py", line 2289, in next
    tarinfo = self.tarinfo.fromtarfile(self)
  File "/usr/lib/python3.7/tarfile.py", line 1097, in fromtarfile
    return obj._proc_member(tarfile)
  File "/usr/lib/python3.7/tarfile.py", line 1119, in _proc_member
    return self._proc_pax(tarfile)
  File "/usr/lib/python3.7/tarfile.py", line 1230, in _proc_pax
    match = regex.match(buf, pos)
OverflowError: Python int too large to convert to C ssize
```
msg358339 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-12-13 16:33
The file is not a valid tar file:

$ tar xf crash-83a6e7d4b810c6a0bd4fd9dfd6a0b36550034ccf

gzip: stdin: invalid compressed data--crc error

gzip: stdin: invalid compressed data--length error
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Child returned status 1
tar: Error is not recoverable: exiting now
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83219
2019-12-13 16:33:19christian.heimessetnosy: + christian.heimes
messages: + msg358339
2019-12-13 16:03:03xtreaksetnosy: + ethan.furman
2019-12-13 15:57:25jvoisincreate