From b6a1e91d87a99d75a3f0bb9da1377594fb4d5678 Mon Sep 17 00:00:00 2001 From: daisicheng Date: Wed, 18 Dec 2024 17:11:53 +0800 Subject: [PATCH] consume z.current prepared by Reader.Read in Reader.WriteTo (cherry picked from commit 44f11f0954e3b3f559c75434dc811f5d57b3f742) --- VERSION-vendor | 2 +- git-commit | 2 +- isula-build.spec | 8 ++++- ...nt-prepared-by-Reader.Read-in-Reader.patch | 36 +++++++++++++++++++ series.conf | 1 + 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 patch/0138-Consume-z.current-prepared-by-Reader.Read-in-Reader.patch diff --git a/VERSION-vendor b/VERSION-vendor index e951d8b..f4e290b 100644 --- a/VERSION-vendor +++ b/VERSION-vendor @@ -1 +1 @@ -0.9.6-23 +0.9.6-24 diff --git a/git-commit b/git-commit index 3198b3c..e91e423 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -58d90d176bffe3c836fed71cabcdbf707590266a +a51590634bf5ef5eabadfcc2a88dc6b04dc319d7 diff --git a/isula-build.spec b/isula-build.spec index 4fc6ba8..648f984 100644 --- a/isula-build.spec +++ b/isula-build.spec @@ -2,7 +2,7 @@ Name: isula-build Version: 0.9.6 -Release: 23 +Release: 24 Summary: A tool to build container images License: Mulan PSL V2 URL: https://gitee.com/openeuler/isula-build @@ -105,6 +105,12 @@ fi /usr/share/bash-completion/completions/isula-build %changelog +* Wed Dec 18 2024 daisicheng - 0.9.6-24 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:Consume z.current prepared by Reader.Read in Reader.WriteTo + * Sun Apr 07 2024 daisicheng - 0.9.6-23 - Type:bugfix - CVE:NA diff --git a/patch/0138-Consume-z.current-prepared-by-Reader.Read-in-Reader.patch b/patch/0138-Consume-z.current-prepared-by-Reader.Read-in-Reader.patch new file mode 100644 index 0000000..d007c4f --- /dev/null +++ b/patch/0138-Consume-z.current-prepared-by-Reader.Read-in-Reader.patch @@ -0,0 +1,36 @@ +From 17e8dac29df8ce00febbd08ee5d8ee922024a003 Mon Sep 17 00:00:00 2001 +From:Miloslav Trmač +Date: Fri, 30 Sep 2022 12:46:21 +0200 +Subject: [PATCH] Consume z.current prepared by Reader.Read in Reader.WriteTo + +--- + vendor/github.com/klauspost/pgzip/gunzip.go | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/vendor/github.com/klauspost/pgzip/gunzip.go b/vendor/github.com/klauspost/pgzip/gunzip.go +index d1ae730..3c4b32f 100644 +--- a/vendor/github.com/klauspost/pgzip/gunzip.go ++++ b/vendor/github.com/klauspost/pgzip/gunzip.go +@@ -513,6 +513,19 @@ func (z *Reader) Read(p []byte) (n int, err error) { + + func (z *Reader) WriteTo(w io.Writer) (n int64, err error) { + total := int64(0) ++ avail := z.current[z.roff:] ++ if len(avail) != 0 { ++ n, err := w.Write(avail) ++ if n != len(avail) { ++ return total, io.ErrShortWrite ++ } ++ total += int64(n) ++ if err != nil { ++ return total, err ++ } ++ z.blockPool <- z.current ++ z.current = nil ++ } + for { + if z.err != nil { + return total, z.err +-- +2.33.0 + diff --git a/series.conf b/series.conf index f765f62..7d5d73c 100644 --- a/series.conf +++ b/series.conf @@ -46,3 +46,4 @@ patch/0134-add-dt-for-interface-manifest-health-status-in-daemo.patch patch/0135-fix-the-login_test-in-daemon-for-euleros-and-openeul.patch patch/0136-add-manifest.json-verification-before-loading-a-tar.patch patch/0137-fix-cflags-for-clang-build.patch +patch/0138-Consume-z.current-prepared-by-Reader.Read-in-Reader.patch