logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0014-Upstream-fix-for-heap-overflow.patch (1094B)


  1. From d97748a061a3beb8bdf4d5d0a2458086951960ff Mon Sep 17 00:00:00 2001
  2. From: Petr Stodulka <pstodulk@redhat.com>
  3. Date: Mon, 14 Sep 2015 18:23:17 +0200
  4. Subject: [PATCH] Upstream fix for heap overflow
  5. ---
  6. crypt.c | 12 +++++++++++-
  7. 1 file changed, 11 insertions(+), 1 deletion(-)
  8. diff --git a/crypt.c b/crypt.c
  9. index 784e411..a8975f2 100644
  10. --- a/crypt.c
  11. +++ b/crypt.c
  12. @@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
  13. GLOBAL(pInfo->encrypted) = FALSE;
  14. defer_leftover_input(__G);
  15. for (n = 0; n < RAND_HEAD_LEN; n++) {
  16. - b = NEXTBYTE;
  17. + /* 2012-11-23 SMS. (OUSPG report.)
  18. + * Quit early if compressed size < HEAD_LEN. The resulting
  19. + * error message ("unable to get password") could be improved,
  20. + * but it's better than trying to read nonexistent data, and
  21. + * then continuing with a negative G.csize. (See
  22. + * fileio.c:readbyte()).
  23. + */
  24. + if ((b = NEXTBYTE) == (ush)EOF)
  25. + {
  26. + return PK_ERR;
  27. + }
  28. h[n] = (uch)b;
  29. Trace((stdout, " (%02x)", h[n]));
  30. }
  31. --
  32. 2.20.1