Commit 33d3528
committed
tar: Always treat negative sizes as error
If a pax global header specifies a negative size, it is possible to
reduce variable `unconsumed` by 512 bytes, leading to a re-reading
of the pax global header. Fortunately the loop verifies that only one
global header per entry is allowed, leading to a later ARCHIVE_FATAL.
Avoid any form of negative size handling and fail early.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>1 parent 6389d17 commit 33d3528
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1304 | 1304 | | |
1305 | 1305 | | |
1306 | 1306 | | |
1307 | | - | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1308 | 1311 | | |
1309 | 1312 | | |
1310 | | - | |
| 1313 | + | |
1311 | 1314 | | |
1312 | 1315 | | |
1313 | 1316 | | |
| |||
1754 | 1757 | | |
1755 | 1758 | | |
1756 | 1759 | | |
1757 | | - | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
1758 | 1764 | | |
1759 | 1765 | | |
1760 | 1766 | | |
| |||
0 commit comments