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.

21 lines
740 B

  1. --- a/crypt.c
  2. +++ b/crypt.c
  3. @@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
  4. GLOBAL(pInfo->encrypted) = FALSE;
  5. defer_leftover_input(__G);
  6. for (n = 0; n < RAND_HEAD_LEN; n++) {
  7. - b = NEXTBYTE;
  8. + /* 2012-11-23 SMS. (OUSPG report.)
  9. + * Quit early if compressed size < HEAD_LEN. The resulting
  10. + * error message ("unable to get password") could be improved,
  11. + * but it's better than trying to read nonexistent data, and
  12. + * then continuing with a negative G.csize. (See
  13. + * fileio.c:readbyte()).
  14. + */
  15. + if ((b = NEXTBYTE) == (ush)EOF)
  16. + {
  17. + return PK_ERR;
  18. + }
  19. h[n] = (uch)b;
  20. Trace((stdout, " (%02x)", h[n]));
  21. }