logo

oasis

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

0022-Fix-bug-in-undefer_input-that-misplaced-the-input-st.patch (1095B)


  1. From 3eda39fac98550990abb9f83d986619d173f9605 Mon Sep 17 00:00:00 2001
  2. From: Mark Adler <madler@alumni.caltech.edu>
  3. Date: Fri, 31 Jan 2020 22:05:56 -0800
  4. Subject: [PATCH] Fix bug in undefer_input() that misplaced the input state.
  5. Fix bug in undefer_input() that misplaced the input state.
  6. ---
  7. fileio.c | 4 +++-
  8. 1 file changed, 3 insertions(+), 1 deletion(-)
  9. diff --git a/fileio.c b/fileio.c
  10. index c10ff63..6290824 100644
  11. --- a/fileio.c
  12. +++ b/fileio.c
  13. @@ -532,8 +532,10 @@ void undefer_input(__G)
  14. * This condition was checked when G.incnt_leftover was set > 0 in
  15. * defer_leftover_input(), and it is NOT allowed to touch G.csize
  16. * before calling undefer_input() when (G.incnt_leftover > 0)
  17. - * (single exception: see read_byte()'s "G.csize <= 0" handling) !!
  18. + * (single exception: see readbyte()'s "G.csize <= 0" handling) !!
  19. */
  20. + if (G.csize < 0L)
  21. + G.csize = 0L;
  22. G.incnt = G.incnt_leftover + (int)G.csize;
  23. G.inptr = G.inptr_leftover - (int)G.csize;
  24. G.incnt_leftover = 0;
  25. --
  26. 2.25.0