patch-fileio_c 1.2 KB

123456789101112131415161718192021222324252627282930
  1. $OpenBSD: patch-fileio_c,v 1.1 2015/02/06 21:37:04 naddy Exp $
  2. Fix CVE-2014-8141: out-of-bounds read issues in getZip64Data()
  3. --- fileio.c.orig Mon Apr 20 02:03:44 2009
  4. +++ fileio.c Thu Feb 5 18:57:59 2015
  5. @@ -176,6 +176,8 @@ static ZCONST char Far FilenameTooLongTrunc[] =
  6. #endif
  7. static ZCONST char Far ExtraFieldTooLong[] =
  8. "warning: extra field too long (%d). Ignoring...\n";
  9. +static ZCONST char Far ExtraFieldCorrupt[] =
  10. + "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
  11. #ifdef WINDLL
  12. static ZCONST char Far DiskFullQuery[] =
  13. @@ -2295,7 +2297,12 @@ int do_string(__G__ length, option) /* return PK-typ
  14. if (readbuf(__G__ (char *)G.extra_field, length) == 0)
  15. return PK_EOF;
  16. /* Looks like here is where extra fields are read */
  17. - getZip64Data(__G__ G.extra_field, length);
  18. + if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
  19. + {
  20. + Info(slide, 0x401, ((char *)slide,
  21. + LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
  22. + error = PK_WARN;
  23. + }
  24. #ifdef UNICODE_SUPPORT
  25. G.unipath_filename = NULL;
  26. if (G.UzO.U_flag < 2) {