aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2015-07-28 23:13:53 -0700
committerMark Adler <madler@alumni.caltech.edu>2015-07-28 23:13:53 -0700
commitc901a34c92c4aa74028f541a9773df726ce2b769 (patch)
treeef30311a5dd8510d2f27b82c1f4b7ed4c112234c
parent51a223def4382fdd0c9531ba77bd10724eae9f5f (diff)
downloadzlib-c901a34c92c4aa74028f541a9773df726ce2b769.tar.gz
zlib-c901a34c92c4aa74028f541a9773df726ce2b769.tar.bz2
zlib-c901a34c92c4aa74028f541a9773df726ce2b769.zip
Avoid uninitialized access by gzclose_w().
-rw-r--r--deflate.c2
-rw-r--r--gzwrite.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/deflate.c b/deflate.c
index 7a9e05e..544521d 100644
--- a/deflate.c
+++ b/deflate.c
@@ -676,7 +676,7 @@ int ZEXPORT deflate (strm, flush)
676 s = strm->state; 676 s = strm->state;
677 677
678 if (strm->next_out == Z_NULL || 678 if (strm->next_out == Z_NULL ||
679 (strm->next_in == Z_NULL && strm->avail_in != 0) || 679 (strm->avail_in != 0 && strm->next_in == Z_NULL) ||
680 (s->status == FINISH_STATE && flush != Z_FINISH)) { 680 (s->status == FINISH_STATE && flush != Z_FINISH)) {
681 ERR_RETURN(strm, Z_STREAM_ERROR); 681 ERR_RETURN(strm, Z_STREAM_ERROR);
682 } 682 }
diff --git a/gzwrite.c b/gzwrite.c
index ad164b2..efff93a 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -47,6 +47,7 @@ local int gz_init(state)
47 gz_error(state, Z_MEM_ERROR, "out of memory"); 47 gz_error(state, Z_MEM_ERROR, "out of memory");
48 return -1; 48 return -1;
49 } 49 }
50 strm->next_in = NULL;
50 } 51 }
51 52
52 /* mark state as initialized */ 53 /* mark state as initialized */