35550b
--- a/fileio.c	2014-12-05 05:06:05 -0600
35550b
+++ b/fileio.c	2017-11-14 01:06:28 -0600
35550b
@@ -1,5 +1,5 @@
35550b
 /*
35550b
-  Copyright (c) 1990-2009 Info-ZIP.  All rights reserved.
35550b
+  Copyright (c) 1990-2017 Info-ZIP.  All rights reserved.
35550b
 
35550b
   See the accompanying file LICENSE, version 2009-Jan-02 or later
35550b
   (the contents of which are also included in unzip.h) for terms of use.
35550b
@@ -1582,6 +1582,8 @@
35550b
     int r = IZ_PW_ENTERED;
35550b
     char *m;
35550b
     char *prompt;
35550b
+    char *ep;
35550b
+    char *zp;
35550b
 
35550b
 #ifndef REENTRANT
35550b
     /* tell picky compilers to shut up about "unused variable" warnings */
35550b
@@ -1590,9 +1592,12 @@
35550b
 
35550b
     if (*rcnt == 0) {           /* First call for current entry */
35550b
         *rcnt = 2;
35550b
-        if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) {
35550b
-            sprintf(prompt, LoadFarString(PasswPrompt),
35550b
-                    FnFilter1(zfn), FnFilter2(efn));
35550b
+        zp = FnFilter1( zfn);
35550b
+        ep = FnFilter2( efn);
35550b
+        prompt = (char *)malloc(        /* Slightly too long (2* "%s"). */
35550b
+         sizeof( PasswPrompt)+ strlen( zp)+ strlen( ep));
35550b
+        if (prompt != (char *)NULL) {
35550b
+            sprintf(prompt, LoadFarString(PasswPrompt), zp, ep);
35550b
             m = prompt;
35550b
         } else
35550b
             m = (char *)LoadFarString(PasswPrompt2);