diff options
| author | CoprDistGit <infra@openeuler.org> | 2026-11-07 06:22:11 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2026-11-07 06:22:11 +0000 |
| commit | d259e194df12569c8fe286eacd285be28118ecd7 (patch) | |
| tree | 838258e9a13837f135e94257e7d17db9c9218608 /backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch | |
| parent | b1143670a63c1a72a4bd0e0e4337fc5fa3be85b4 (diff) | |
automatic import of zlibopeneuler24.03_LTS_SP3
Diffstat (limited to 'backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch')
| -rw-r--r-- | backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch b/backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch new file mode 100644 index 0000000..1d488ba --- /dev/null +++ b/backport-Fix-crash-when-gzsetparams-attempted-for-transparent-write.patch @@ -0,0 +1,26 @@ +From 02a6049eb3884c430268bb0fe3296d597a03174c Mon Sep 17 00:00:00 2001 +From: Mark Adler <madler@alumni.caltech.edu> +Date: Mon, 26 Dec 2022 23:36:01 -0800 +Subject: [PATCH] Fix crash when gzsetparams() attempted for transparent write. + +gzsetparams() now returns a Z_STREAM_ERROR in this case.i + +Reference:https://github.com/madler/zlib/commit/02a6049eb3884c430268bb0fe3296d597a03174c +Conflict:NA +--- + gzwrite.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gzwrite.c b/gzwrite.c +index eb8a0e589..3030d74d6 100644 +--- a/gzwrite.c ++++ b/gzwrite.c +@@ -609,7 +609,7 @@ int ZEXPORT gzsetparams(file, level, strategy) + strm = &(state->strm); + + /* check that we're writing and that there's no error */ +- if (state->mode != GZ_WRITE || state->err != Z_OK) ++ if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct) + return Z_STREAM_ERROR; + + /* if no change is requested, then do nothing */ |
