summaryrefslogtreecommitdiff
path: root/inflate.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2016-10-24 20:11:41 -0700
committerHans Kristian Rosbach <hk-git@circlestorm.org>2017-02-01 12:22:21 +0100
commit6d55bd6a784d881a4b778c9354f462bde1ceee12 (patch)
treef34f52861054c91e29eb575c8756e558787f09d3 /inflate.h
parent647564776f309556cde879da67b885bf9099804c (diff)
Do a more thorough check of the state for every stream call.
This verifies that the state has been initialized, that it is the expected type of state, deflate or inflate, and that at least the first several bytes of the internal state have not been clobbered.
Diffstat (limited to 'inflate.h')
-rw-r--r--inflate.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/inflate.h b/inflate.h
index e33330a..a1849e0 100644
--- a/inflate.h
+++ b/inflate.h
@@ -21,7 +21,7 @@
/* Possible inflate modes between inflate() calls */
typedef enum {
- HEAD, /* i: waiting for magic header */
+ HEAD = 16180, /* i: waiting for magic header */
FLAGS, /* i: waiting for method and flags (gzip) */
TIME, /* i: waiting for modification time (gzip) */
OS, /* i: waiting for extra flags and operating system (gzip) */
@@ -83,6 +83,7 @@ typedef enum {
/* State maintained between inflate() calls -- approximately 7K bytes, not
including the allocated sliding window, which is up to 32K bytes. */
struct inflate_state {
+ z_stream *strm; /* pointer back to this zlib stream */
inflate_mode mode; /* current inflate mode */
int last; /* true if processing last block */
int wrap; /* bit 0 true for zlib, bit 1 true for gzip,