diff options
author | Yang Tse <yangsita@gmail.com> | 2011-08-18 20:09:26 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-08-18 20:10:51 +0200 |
commit | 9afb343368280b76135889976b5f351c94f58823 (patch) | |
tree | 4ff21f2b3eac959d29fe888cf7a1d8174a5cd7ed /lib/content_encoding.c | |
parent | 18339846644fff08817498895e27d0177c80ed5b (diff) | |
download | curl-9afb343368280b76135889976b5f351c94f58823.tar.gz |
zlib: enforce full initialization of our data space z_stream structs
Diffstat (limited to 'lib/content_encoding.c')
-rw-r--r-- | lib/content_encoding.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 63bc2433c..84d76f4b9 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -158,11 +158,7 @@ Curl_unencode_deflate_write(struct connectdata *conn, /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; + memset(z, 0, sizeof(z_stream)); if(inflateInit(z) != Z_OK) return process_zlib_error(conn, z); k->zlib_init = ZLIB_INIT; @@ -269,11 +265,7 @@ Curl_unencode_gzip_write(struct connectdata *conn, /* Initialize zlib? */ if(k->zlib_init == ZLIB_UNINIT) { - z->zalloc = (alloc_func)Z_NULL; - z->zfree = (free_func)Z_NULL; - z->opaque = 0; - z->next_in = NULL; - z->avail_in = 0; + memset(z, 0, sizeof(z_stream)); if(strcmp(zlibVersion(), "1.2.0.4") >= 0) { /* zlib ver. >= 1.2.0.4 supports transparent gzip decompressing */ |