GNU bug report logs - #75924
maint: fix s390 buffer flushes

Previous Next

Package: gzip;

Reported by: Eduard Stefes <eduard.stefes <at> ibm.com>

Date: Wed, 29 Jan 2025 14:20:02 UTC

Severity: normal

Merged with 74651, 75911

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eduard Stefes <eduard.stefes <at> ibm.com>
Cc: 75924 <at> debbugs.gnu.org, Andreas Hasenack <andreas.hasenack <at> canonical.com>, Eduard Stefes <eduard.stefes <at> ibm.com>, Ilya Leoshkevich <iii <at> linux.ibm.com>
Subject: bug#75924: gzip: add special eof handling for s390x
Date: Mon, 17 Feb 2025 11:44:09 +0100
due to hardware limitations we cannot rely on the OESC error code
before the hardware parsed the initial huffman tree. For this case
we have to add a branch to the EOF handling. we return an errorcode 2
(invalid data) if we where still in the initial phase (bytes_out == 0).
Otherwise we continue with the default EOF handling.
---
 dfltcc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dfltcc.c b/dfltcc.c
index 9f86581..e45b3ce 100644
--- a/dfltcc.c
+++ b/dfltcc.c
@@ -18,6 +18,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <errno.h>
 
 #ifdef HAVE_SYS_SDT_H
 # include <sys/sdt.h>
@@ -438,6 +439,8 @@ dfltcc_inflate ()
             {
               /* Premature EOF.  */
               flush_outbuf ();
+              if (bytes_out == 0)
+                return 2;
               errno = 0;
               read_error ();
             }
-- 
2.48.1





This bug report was last modified 42 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.