unzip-6.0-format-secure.patch 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. diff --git a/extract.c b/extract.c
  2. index eeb2f57..a0a4929 100644
  3. --- a/extract.c
  4. +++ b/extract.c
  5. @@ -472,8 +472,8 @@ int extract_or_test_files(__G) /* return PK-type error code */
  6. */
  7. Info(slide, 0x401, ((char *)slide,
  8. LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1));
  9. - Info(slide, 0x401, ((char *)slide,
  10. - LoadFarString(ReportMsg)));
  11. + Info(slide, 0x401,
  12. + ((char *)slide,"%s", LoadFarString(ReportMsg)));
  13. error_in_archive = PK_BADERR;
  14. }
  15. reached_end = TRUE; /* ...so no more left to do */
  16. @@ -752,8 +752,8 @@ int extract_or_test_files(__G) /* return PK-type error code */
  17. #ifndef SFX
  18. if (no_endsig_found) { /* just to make sure */
  19. - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
  20. - Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg)));
  21. + Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg)));
  22. + Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(ReportMsg)));
  23. if (!error_in_archive) /* don't overwrite stronger error */
  24. error_in_archive = PK_WARN;
  25. }
  26. diff --git a/list.c b/list.c
  27. index 15e0011..f7359c3 100644
  28. --- a/list.c
  29. +++ b/list.c
  30. @@ -181,7 +181,7 @@ int list_files(__G) /* return PK-type error code */
  31. Info(slide, 0x401,
  32. ((char *)slide, LoadFarString(CentSigMsg), j));
  33. Info(slide, 0x401,
  34. - ((char *)slide, LoadFarString(ReportMsg)));
  35. + ((char *)slide,"%s", LoadFarString(ReportMsg)));
  36. return PK_BADERR; /* sig not found */
  37. }
  38. }
  39. @@ -507,7 +507,8 @@ int list_files(__G) /* return PK-type error code */
  40. && (!G.ecrec.is_zip64_archive)
  41. && (memcmp(G.sig, end_central_sig, 4) != 0)
  42. ) { /* just to make sure again */
  43. - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
  44. + Info(slide, 0x401,
  45. + ((char *)slide,"%s", LoadFarString(EndSigMsg)));
  46. error_in_archive = PK_WARN; /* didn't find sig */
  47. }
  48. @@ -591,7 +592,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */
  49. Info(slide, 0x401,
  50. ((char *)slide, LoadFarString(CentSigMsg), j));
  51. Info(slide, 0x401,
  52. - ((char *)slide, LoadFarString(ReportMsg)));
  53. + ((char *)slide,"%s", LoadFarString(ReportMsg)));
  54. return PK_BADERR; /* sig not found */
  55. }
  56. }
  57. @@ -674,7 +675,7 @@ int get_time_stamp(__G__ last_modtime, nmember) /* return PK-type error code */
  58. ---------------------------------------------------------------------------*/
  59. if (memcmp(G.sig, end_central_sig, 4)) { /* just to make sure again */
  60. - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
  61. + Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg)));
  62. error_in_archive = PK_WARN;
  63. }
  64. if (*nmember == 0L && error_in_archive <= PK_WARN)
  65. diff --git a/zipinfo.c b/zipinfo.c
  66. index 6e22cc8..ac5c61b 100644
  67. --- a/zipinfo.c
  68. +++ b/zipinfo.c
  69. @@ -771,7 +771,7 @@ int zipinfo(__G) /* return PK-type error code */
  70. Info(slide, 0x401,
  71. ((char *)slide, LoadFarString(CentSigMsg), j));
  72. Info(slide, 0x401,
  73. - ((char *)slide, LoadFarString(ReportMsg)));
  74. + ((char *)slide,"%s", LoadFarString(ReportMsg)));
  75. error_in_archive = PK_BADERR; /* sig not found */
  76. break;
  77. }
  78. @@ -960,7 +960,8 @@ int zipinfo(__G) /* return PK-type error code */
  79. && (!G.ecrec.is_zip64_archive)
  80. && (memcmp(G.sig, end_central_sig, 4) != 0)
  81. ) { /* just to make sure again */
  82. - Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
  83. + Info(slide, 0x401,
  84. + ((char *)slide,"%s", LoadFarString(EndSigMsg)));
  85. error_in_archive = PK_WARN; /* didn't find sig */
  86. }