zlib/zlib-1.2.11-inflateSyncPoint-return-value-fix.patch

46 lines
1.3 KiB
Diff
Raw Normal View History

Subject: [PATCH] Fixed inflateSyncPoint() bad return value on z15
---
contrib/s390/dfltcc.h | 4 ++++
inflate.c | 2 ++
2 files changed, 6 insertions(+)
diff --git a/contrib/s390/dfltcc.h b/contrib/s390/dfltcc.h
index 574e84c..7960626 100644
--- a/contrib/s390/dfltcc.h
+++ b/contrib/s390/dfltcc.h
@@ -51,5 +51,9 @@ int ZLIB_INTERNAL dfltcc_inflate_disable OF((z_streamp strm));
do { \
if (dfltcc_was_inflate_used((strm))) return -(1L << 16); \
} while (0)
+#define INFLATE_SYNC_POINT_HOOK(strm) \
+ do { \
+ if (dfltcc_was_inflate_used((strm))) return Z_STREAM_ERROR; \
+ } while (0)
#endif
\ No newline at end of file
diff --git a/inflate.c b/inflate.c
index f77c2ae..596034c 100644
--- a/inflate.c
+++ b/inflate.c
@@ -100,6 +100,7 @@
#define INFLATE_NEED_CHECKSUM(strm) 1
#define INFLATE_NEED_UPDATEWINDOW(strm) 1
#define INFLATE_MARK_HOOK(strm) do {} while (0)
+#define INFLATE_SYNC_POINT_HOOK(strm) do {} while (0)
#endif
#ifdef MAKEFIXED
@@ -1483,6 +1484,7 @@ z_streamp strm;
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ INFLATE_SYNC_POINT_HOOK(strm);
state = (struct inflate_state FAR *)strm->state;
return state->mode == STORED && state->bits == 0;
}
--
2.26.0