crc32.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --- unzip60/extract.c 2010-04-03 14:41:55 -0500
  2. +++ unzip60/extract.c 2014-12-03 15:33:35 -0600
  3. @@ -1,5 +1,5 @@
  4. /*
  5. - Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
  6. + Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
  7. See the accompanying file LICENSE, version 2009-Jan-02 or later
  8. (the contents of which are also included in unzip.h) for terms of use.
  9. @@ -298,6 +298,8 @@
  10. #ifndef SFX
  11. static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
  12. EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
  13. + static ZCONST char Far TooSmallEFlength[] = "bad extra-field entry:\n \
  14. + EF block length (%u bytes) invalid (< %d)\n";
  15. static ZCONST char Far InvalidComprDataEAs[] =
  16. " invalid compressed data for EAs\n";
  17. # if (defined(WIN32) && defined(NTSD_EAS))
  18. @@ -2023,7 +2025,8 @@
  19. ebID = makeword(ef);
  20. ebLen = (unsigned)makeword(ef+EB_LEN);
  21. - if (ebLen > (ef_len - EB_HEADSIZE)) {
  22. + if (ebLen > (ef_len - EB_HEADSIZE))
  23. + {
  24. /* Discovered some extra field inconsistency! */
  25. if (uO.qflag)
  26. Info(slide, 1, ((char *)slide, "%-22s ",
  27. @@ -2032,6 +2035,16 @@
  28. ebLen, (ef_len - EB_HEADSIZE)));
  29. return PK_ERR;
  30. }
  31. + else if (ebLen < EB_HEADSIZE)
  32. + {
  33. + /* Extra block length smaller than header length. */
  34. + if (uO.qflag)
  35. + Info(slide, 1, ((char *)slide, "%-22s ",
  36. + FnFilter1(G.filename)));
  37. + Info(slide, 1, ((char *)slide, LoadFarString(TooSmallEFlength),
  38. + ebLen, EB_HEADSIZE));
  39. + return PK_ERR;
  40. + }
  41. switch (ebID) {
  42. case EF_OS2: