Blame SOURCES/unzip-6.0-cve-2018-18384.patch

1ed299
--- unzip60/list.c	
1ed299
+++ unzip60/list.c	
1ed299
@@ -97,7 +97,7 @@ int list_files(__G)    /* return PK-type
1ed299
 {
1ed299
     int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
1ed299
 #ifndef WINDLL
1ed299
-    char sgn, cfactorstr[13];
1ed299
+    char sgn, cfactorstr[1+10+1+1];	/* <sgn><int>%NUL */
1ed299
     int longhdr=(uO.vflag>1);
1ed299
 #endif
1ed299
     int date_format;
1ed299
@@ -389,9 +389,9 @@ int list_files(__G)    /* return PK-type
1ed299
             }
1ed299
 #else /* !WINDLL */
1ed299
             if (cfactor == 100)
1ed299
-                sprintf(cfactorstr, LoadFarString(CompFactor100));
1ed299
+                snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactor100));
1ed299
             else
1ed299
-                sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor);
1ed299
+                snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactorStr), sgn, cfactor);
1ed299
             if (longhdr)
1ed299
                 Info(slide, 0, ((char *)slide, LoadFarString(LongHdrStats),
1ed299
                   FmZofft(G.crec.ucsize, "8", "u"), methbuf,
1ed299
@@ -471,9 +471,9 @@ int list_files(__G)    /* return PK-type
1ed299
 
1ed299
 #else /* !WINDLL */
1ed299
         if (cfactor == 100)
1ed299
-            sprintf(cfactorstr, LoadFarString(CompFactor100));
1ed299
+            snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactor100));
1ed299
         else
1ed299
-            sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor);
1ed299
+            snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactorStr), sgn, cfactor);
1ed299
         if (longhdr) {
1ed299
             Info(slide, 0, ((char *)slide, LoadFarString(LongFileTrailer),
1ed299
               FmZofft(tot_ucsize, "8", "u"), FmZofft(tot_csize, "8", "u"),