aboutsummaryrefslogtreecommitdiff
path: root/gzwrite.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2022-12-26 23:36:01 -0800
committerMark Adler <madler@alumni.caltech.edu>2022-12-26 23:38:00 -0800
commit02a6049eb3884c430268bb0fe3296d597a03174c (patch)
tree815a3a56dee2e077baf119ca61c3d2f94d777255 /gzwrite.c
parente554695638228b846d49657f31eeff0ca4680e8a (diff)
downloadzlib-02a6049eb3884c430268bb0fe3296d597a03174c.tar.gz
zlib-02a6049eb3884c430268bb0fe3296d597a03174c.tar.bz2
zlib-02a6049eb3884c430268bb0fe3296d597a03174c.zip
Fix crash when gzsetparams() attempted for transparent write.
gzsetparams() now returns a Z_STREAM_ERROR in this case.
Diffstat (limited to 'gzwrite.c')
-rw-r--r--gzwrite.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gzwrite.c b/gzwrite.c
index eb8a0e5..3030d74 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -609,7 +609,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
609 strm = &(state->strm); 609 strm = &(state->strm);
610 610
611 /* check that we're writing and that there's no error */ 611 /* check that we're writing and that there's no error */
612 if (state->mode != GZ_WRITE || state->err != Z_OK) 612 if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct)
613 return Z_STREAM_ERROR; 613 return Z_STREAM_ERROR;
614 614
615 /* if no change is requested, then do nothing */ 615 /* if no change is requested, then do nothing */