Commit d94bf22
Backport fixes for multiple security vulnerabilities to bundled
libzip 0.6.1. A full library upgrade is not feasible due to breaking
API changes in libzip 0.11+.
Fixes:
- CVE-2012-1162: heap buffer overflow in _zip_readcdir when nentry
is 0 but central directory data is present. Initialize directory
entries before reading to prevent use of uninitialized memory.
- CVE-2012-1163: integer overflow in central directory size
calculation. Validate cd->size + cd->comment_len + EOCDLEN does
not wrap. Add overflow guards before size*nentry allocations.
- CVE-2015-2331: integer overflow in _zip_cdir_new when computing
allocation size for large nentry values on 32-bit systems.
- Fix memory leaks on error paths in _zip_dirent_read where partial
allocations (filename, extrafield, comment) were not freed on
subsequent allocation failures (related to CVE-2017-12858).
- Replace deprecated stricmp with portable strcasecmp in
zip_name_locate.
Note: CVE-2011-0421 was already patched in the bundled copy.
CVE-2017-14107 does not apply (no ZIP64 support in 0.6.1).
CVE-2017-12858 and CVE-2019-17582 manifest differently in 0.6.1
(memory leak, not double-free/use-after-free) and are addressed
by the error-path cleanup above.
Reference: open-watcom#1369
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bea1313 commit d94bf22
3 files changed
Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
86 | 95 | | |
87 | 96 | | |
88 | 97 | | |
| |||
282 | 291 | | |
283 | 292 | | |
284 | 293 | | |
285 | | - | |
| 294 | + | |
| 295 | + | |
286 | 296 | | |
| 297 | + | |
287 | 298 | | |
288 | 299 | | |
289 | 300 | | |
290 | 301 | | |
291 | | - | |
| 302 | + | |
| 303 | + | |
292 | 304 | | |
| 305 | + | |
293 | 306 | | |
294 | 307 | | |
295 | 308 | | |
| |||
302 | 315 | | |
303 | 316 | | |
304 | 317 | | |
305 | | - | |
| 318 | + | |
| 319 | + | |
306 | 320 | | |
| 321 | + | |
307 | 322 | | |
308 | 323 | | |
309 | 324 | | |
310 | 325 | | |
311 | | - | |
| 326 | + | |
| 327 | + | |
312 | 328 | | |
| 329 | + | |
313 | 330 | | |
314 | 331 | | |
315 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
| |||
269 | 279 | | |
270 | 280 | | |
271 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
272 | 289 | | |
273 | 290 | | |
274 | 291 | | |
| |||
309 | 326 | | |
310 | 327 | | |
311 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
312 | 332 | | |
313 | 333 | | |
314 | 334 | | |
| |||
0 commit comments