You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.2 KiB

  1. --- a/fileio.c
  2. +++ b/fileio.c
  3. @@ -1,5 +1,5 @@
  4. /*
  5. - Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
  6. + Copyright (c) 1990-2017 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. @@ -1582,6 +1582,8 @@
  10. int r = IZ_PW_ENTERED;
  11. char *m;
  12. char *prompt;
  13. + char *ep;
  14. + char *zp;
  15. #ifndef REENTRANT
  16. /* tell picky compilers to shut up about "unused variable" warnings */
  17. @@ -1590,9 +1592,12 @@
  18. if (*rcnt == 0) { /* First call for current entry */
  19. *rcnt = 2;
  20. - if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) {
  21. - sprintf(prompt, LoadFarString(PasswPrompt),
  22. - FnFilter1(zfn), FnFilter2(efn));
  23. + zp = FnFilter1( zfn);
  24. + ep = FnFilter2( efn);
  25. + prompt = (char *)malloc( /* Slightly too long (2* "%s"). */
  26. + sizeof( PasswPrompt)+ strlen( zp)+ strlen( ep));
  27. + if (prompt != (char *)NULL) {
  28. + sprintf(prompt, LoadFarString(PasswPrompt), zp, ep);
  29. m = prompt;
  30. } else
  31. m = (char *)LoadFarString(PasswPrompt2);