diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2022-12-26 23:36:01 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2022-12-26 23:38:00 -0800 |
commit | 02a6049eb3884c430268bb0fe3296d597a03174c (patch) | |
tree | 815a3a56dee2e077baf119ca61c3d2f94d777255 /gzwrite.c | |
parent | e554695638228b846d49657f31eeff0ca4680e8a (diff) | |
download | zlib-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |