Subject: bug#75924: gzip: add special eof handling for s390x

From: Eduard Stefes <[email-masked]>
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