unzip-6.0_CVE-2021-4217.patch 581 B

1234567891011121314151617181920
  1. diff --git a/process.c b/process.c
  2. index d2a846e..cba2463 100644
  3. --- a/process.c
  4. +++ b/process.c
  5. @@ -2064,10 +2064,14 @@ int getUnicodeData(__G__ ef_buf, ef_len)
  6. G.unipath_checksum = makelong(offset + ef_buf);
  7. offset += 4;
  8. + if (!G.filename_full) {
  9. + /* Check if we have a unicode extra section but no filename set */
  10. + return PK_ERR;
  11. + }
  12. +
  13. /*
  14. * Compute 32-bit crc
  15. */
  16. -
  17. chksum = crc32(chksum, (uch *)(G.filename_full),
  18. strlen(G.filename_full));