|
1 |
| -Improvezipfilevalidation in `zipfile.is_zipfile`. |
| 1 | +ImproveZip filevalidation in:func:`zipfile.is_zipfile`. |
2 | 2 |
|
3 |
| -Before this change `zipfile.is_zipfile()` only checked the End Central Directory |
| 3 | +Before this change:func:`zipfile.is_zipfile` only checked the End Central Directory |
4 | 4 | signature. If the signature could be found in the last 64k of the file,
|
5 |
| -success! This produced false positives on any file with `'PK\x05\x06'` in the |
| 5 | +success! This produced false positives on any file with ``'PK\x05\x06'`` in the |
6 | 6 | last 64k of the file - including PDFs and PNGs.
|
7 | 7 |
|
8 | 8 | This is now corrected by actually validating the Central Directory location
|
9 |
| -and size based on the information provided by the End Central Directory |
| 9 | +and size based on the information provided by the EndofCentral Directory |
10 | 10 | along with verifying the Central Directory signature of the first entry.
|
11 | 11 |
|
12 |
| -This should be sufficient for the vast number ofzipfiles with fewer |
| 12 | +This should be sufficient for the vast number ofZip files with fewer |
13 | 13 | false positives.
|