diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2015-07-28 23:13:53 -0700 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2015-07-28 23:13:53 -0700 |
| commit | c901a34c92c4aa74028f541a9773df726ce2b769 (patch) | |
| tree | ef30311a5dd8510d2f27b82c1f4b7ed4c112234c | |
| parent | 51a223def4382fdd0c9531ba77bd10724eae9f5f (diff) | |
| download | zlib-c901a34c92c4aa74028f541a9773df726ce2b769.tar.gz zlib-c901a34c92c4aa74028f541a9773df726ce2b769.tar.bz2 zlib-c901a34c92c4aa74028f541a9773df726ce2b769.zip | |
Avoid uninitialized access by gzclose_w().
| -rw-r--r-- | deflate.c | 2 | ||||
| -rw-r--r-- | gzwrite.c | 1 |
2 files changed, 2 insertions, 1 deletions
| @@ -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 | } |
| @@ -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 */ |
