[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Daniel.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread miss-islington


miss-islington  added the comment:


New changeset 3801b2699eb9441ca31c6ec8fa956fc0fe755ef7 by Miss Skeleton (bot) 
in branch '3.8':
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. 
(GH-14656)
https://github.com/python/cpython/commit/3801b2699eb9441ca31c6ec8fa956fc0fe755ef7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread miss-islington


miss-islington  added the comment:


New changeset f7d50f8f997fbfce1556991a3700826536871fe7 by Miss Skeleton (bot) 
in branch '3.7':
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. 
(GH-14656)
https://github.com/python/cpython/commit/f7d50f8f997fbfce1556991a3700826536871fe7


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16505
pull_request: https://github.com/python/cpython/pull/16979

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16506
pull_request: https://github.com/python/cpython/pull/16980

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-10-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset da6ce58dd5ac109485af45878fca6bfd265b43e9 by Serhiy Storchaka 
(Daniel Hillier) in branch 'master':
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. 
(GH-14656)
https://github.com/python/cpython/commit/da6ce58dd5ac109485af45878fca6bfd265b43e9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-07-09 Thread Daniel Hillier


Daniel Hillier  added the comment:

I've pushed a PR which adds a test that generates corrupt zip64 files with 
different combinations of zip64 extra data lengths and zip64 flags (which 
determines how many fields are required in the extra data).

It now raises a BadZipFile with a message naming the first missing field.

--
nosy: +dhillier

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-07-08 Thread Daniel Hillier


Change by Daniel Hillier :


--
pull_requests: +14463
pull_request: https://github.com/python/cpython/pull/14656

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-06-11 Thread alter-bug-tracer


alter-bug-tracer  added the comment:

@berker.peksag, first of all sorry for the late reply. 
We are not sure that we know how to do that. Our tests are generated 
automatically. What we can do is retest the lib with your temporary fixes in 
place, to see if they fix all the problems our software can detect. Would that 
help you?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-06-01 Thread Berker Peksag


Berker Peksag  added the comment:

@alter-bug-tracer, could you please create test files for the cases Serhiy has 
just mentioned?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-06-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is not enough. IndexError can be raised for ln == 8 or 16 when file_size, 
compress_size and header_offset are all set to 0x.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-06-01 Thread Berker Peksag


Change by Berker Peksag :


--
keywords: +patch
pull_requests: +13611
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/13727

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-06-01 Thread Berker Peksag


Berker Peksag  added the comment:

This report is valid. Serhiy has improved error reporting of the extra field in 
feccdb2a249a71be330765be77dee57121866779.

counts can indeed be an empty tuple:

elif ln == 0:
counts = ()

If I'm reading section 4.5.3 of 
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT correctly, I think 
we need to raise BadZipFile if ln == 0.

--
components: +Library (Lib)
nosy: +berker.peksag, serhiy.storchaka
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open
type:  -> behavior
versions:  -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-05-22 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

unzip index_tuple.zip -x
Archive:  index_tuple.zip

caution:  zipfile comment truncated
error [index_tuple.zip]:  missing 3992977728 bytes in zipfile
  (attempting to process anyway)
   skipping: zipfile_extract/unsupported compression method 211


I think the issue is not with Python but with your ZIP file. Did you try to 
uncompress it with unzip?\

Thank you

--
nosy: +matrixise
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36993] zipfile: tuple IndexError on extract

2019-05-21 Thread alter-bug-tracer


New submission from alter-bug-tracer :

The following code throws an IndexError when attempting to extract a malformed 
archive (attached):

import zipfile
import sys

zf = zipfile.ZipFile(sys.argv[1])
for info in zf.infolist():
  zf.extract(info.filename)

Result:
Traceback (most recent call last):
  File "code.py", line 4, in 
zf = zipfile.ZipFile(sys.argv[1])
  File "/usr/local/lib/python3.8/zipfile.py", line 1230, in __init__
self._RealGetContents()
  File "/usr/local/lib/python3.8/zipfile.py", line 1353, in _RealGetContents
x._decodeExtra()
  File "/usr/local/lib/python3.8/zipfile.py", line 480, in _decodeExtra
self.file_size = counts[idx]
IndexError: tuple index out of range

--
files: index_tuple.zip
messages: 343038
nosy: alter-bug-tracer
priority: normal
severity: normal
status: open
title: zipfile: tuple IndexError on extract
versions: Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file48348/index_tuple.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com