You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
971 B

  1. --- a/extract.c
  2. +++ b/extract.c
  3. @@ -2228,6 +2228,7 @@ static int test_compr_eb(__G__ eb, eb_si
  4. ulg eb_ucsize;
  5. uch *eb_ucptr;
  6. int r;
  7. + ush eb_compr_method;
  8. if (compr_offset < 4) /* field is not compressed: */
  9. return PK_OK; /* do nothing and signal OK */
  10. @@ -2244,6 +2245,14 @@ static int test_compr_eb(__G__ eb, eb_si
  11. ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
  12. return IZ_EF_TRUNC; /* no/bad compressed data! */
  13. + /* 2014-11-03 Michal Zalewski, SMS.
  14. + * For STORE method, compressed and uncompressed sizes must agree.
  15. + * http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=450
  16. + */
  17. + eb_compr_method = makeword( eb + (EB_HEADSIZE + compr_offset));
  18. + if ((eb_compr_method == STORED) && (eb_size - compr_offset != eb_ucsize))
  19. + return PK_ERR;
  20. +
  21. if (
  22. #ifdef INT_16BIT
  23. (((ulg)(extent)eb_ucsize) != eb_ucsize) ||