#21 Fix for DFLTCC issue on s390x
Closed a year ago by ljavorsk. Opened a year ago by lbalhar.
rpms/ lbalhar/zlib rawhide  into  rawhide

@@ -0,0 +1,56 @@ 

+ diff --git a/contrib/s390/dfltcc.c b/contrib/s390/dfltcc.c

+ index aa0b7a3..2fc2d8b 100644

+ --- a/contrib/s390/dfltcc.c

+ +++ b/contrib/s390/dfltcc.c

+ @@ -457,7 +457,10 @@ again:

+          *strm->next_out = (Bytef)state->bi_buf;

+      /* Honor history and check value */

+      param->nt = 0;

+ -    param->cv = state->wrap == 2 ? ZSWAP32(strm->adler) : strm->adler;

+ +    if (state->wrap == 1)

+ +        param->cv = strm->adler;

+ +    else if (state->wrap == 2)

+ +        param->cv = ZSWAP32(strm->adler);

+  

+      /* When opening a block, choose a Huffman-Table Type */

+      if (!param->bcf) {

+ @@ -489,7 +492,10 @@ again:

+          state->bi_buf = 0; /* Avoid accessing next_out */

+      else

+          state->bi_buf = *strm->next_out & ((1 << state->bi_valid) - 1);

+ -    strm->adler = state->wrap == 2 ? ZSWAP32(param->cv) : param->cv;

+ +    if (state->wrap == 1)

+ +        strm->adler = param->cv;

+ +    else if (state->wrap == 2)

+ +        strm->adler = ZSWAP32(param->cv);

+  

+      /* Unmask the input data */

+      strm->avail_in += masked_avail_in;

+ @@ -605,13 +611,14 @@ dfltcc_inflate_action ZLIB_INTERNAL dfltcc_inflate(strm, flush, ret)

+      }

+  

+      /* Translate stream to parameter block */

+ -    param->cvt = state->flags ? CVT_CRC32 : CVT_ADLER32;

+ +    param->cvt = ((state->wrap & 4) && state->flags) ? CVT_CRC32 : CVT_ADLER32;

+      param->sbb = state->bits;

+      param->hl = state->whave; /* Software and hardware history formats match */

+      param->ho = (state->wnext - state->whave) & ((1 << HB_BITS) - 1);

+      if (param->hl)

+          param->nt = 0; /* Honor history for the first block */

+ -    param->cv = state->flags ? ZSWAP32(state->check) : state->check;

+ +    if (state->wrap & 4)

+ +        param->cv = state->flags ? ZSWAP32(state->check) : state->check;

+  

+      /* Inflate */

+      do {

+ @@ -624,7 +631,9 @@ dfltcc_inflate_action ZLIB_INTERNAL dfltcc_inflate(strm, flush, ret)

+      state->bits = param->sbb;

+      state->whave = param->hl;

+      state->wnext = (param->ho + param->hl) & ((1 << HB_BITS) - 1);

+ -    strm->adler = state->check = state->flags ? ZSWAP32(param->cv) : param->cv;

+ +    if (state->wrap & 4)

+ +        strm->adler = state->check = state->flags ?

+ +                                     ZSWAP32(param->cv) : param->cv;

+      if (cc == DFLTCC_CC_OP2_CORRUPT && param->oesc != 0) {

+          /* Report an error if stream is corrupted */

+          state->mode = BAD;

file modified
+8 -1
@@ -2,7 +2,7 @@ 

  

  Name:    zlib

  Version: 1.2.13

- Release: 1%{?dist}

+ Release: 2%{?dist}

  Summary: Compression and decompression library

  # /contrib/dotzlib/ have Boost license

  License: zlib and Boost
@@ -27,6 +27,8 @@ 

  # fixed issues found by covscan for rhel-9

  # ref: https://github.com/madler/zlib/pull/554

  Patch23: zlib-1.2.11-covscan-issues-rhel9.patch

+ # fix for https://bugzilla.redhat.com/show_bug.cgi?id=2155328

+ Patch24: zlib-1.2.13-s390x-dfltcc.patch

  

  BuildRequires: make

  BuildRequires: automake, autoconf, libtool
@@ -87,6 +89,7 @@ 

  %patch20 -p1

  %patch22 -p1

  %patch23 -p1

+ %patch24 -p1

  # Patch19 conflicts with Patch1, so the Patch1 has to be applied after,

  # because it is arch specific

  %ifarch s390 s390x
@@ -169,6 +172,10 @@ 

  

  

  %changelog

+ * Thu Dec 22 2022 Lumír Balhar <lbalhar@redhat.com> - 1.2.13-2

+ - Fix for DFLTCC issue on s390x

+ - Resolves: rhbz#2155328

+ 

  * Mon Oct 17 2022 Lukas Javorsky <ljavorsk@redhat.com> - 1.2.13-1

  - Rebase to version 1.2.13

  - Patches 21,24,25 has been upstreamed

rebased onto 42e9d15

a year ago

I'm working on rebasing the actual patch used for this change.

PR will be ready soon.

Pull-Request has been closed by ljavorsk

a year ago
Metadata