Avoid uninitialized access by gzclose_w().

pull/115/head
Mark Adler 10 years ago
parent 51a223def4
commit c901a34c92
  1. 2
      deflate.c
  2. 1
      gzwrite.c

@ -676,7 +676,7 @@ int ZEXPORT deflate (strm, flush)
s = strm->state;
if (strm->next_out == Z_NULL ||
(strm->next_in == Z_NULL && strm->avail_in != 0) ||
(strm->avail_in != 0 && strm->next_in == Z_NULL) ||
(s->status == FINISH_STATE && flush != Z_FINISH)) {
ERR_RETURN(strm, Z_STREAM_ERROR);
}

@ -47,6 +47,7 @@ local int gz_init(state)
gz_error(state, Z_MEM_ERROR, "out of memory");
return -1;
}
strm->next_in = NULL;
}
/* mark state as initialized */

Loading…
Cancel
Save