From b33be0d4df581573a95bc4e25a894f6c60990d7b4980e0866c376f403de45b3e Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 23 Jan 2019 10:45:30 +0000 Subject: [PATCH 1/3] - Update to version 1.0.2 + Use hash table for finding identical chunks, speeding up process considerably + Add test case to verify that identical chunk checking is working + Turn off some tests for big-endian architectures since zstd isn't deterministic on them + Add zck_gen_zdict binary to generate optimal zdict for a zchunk file + Add functions to API to simplify extracting a single chunk + Change default zstd compression to 9 for a 6x speed increase in compression speed for a 5% increase in compression size + Switch from optional flags to more robust optional elements + Sanity check hex hashes passed in as an option OBS-URL: https://build.opensuse.org/package/show/Archiving/zchunk?expand=0&rev=15 --- zchunk-0.9.13.tar.gz | 3 --- zchunk-1.0.2.tar.gz | 3 +++ zchunk.changes | 21 +++++++++++++++++++++ zchunk.spec | 4 ++-- 4 files changed, 26 insertions(+), 5 deletions(-) delete mode 100644 zchunk-0.9.13.tar.gz create mode 100644 zchunk-1.0.2.tar.gz diff --git a/zchunk-0.9.13.tar.gz b/zchunk-0.9.13.tar.gz deleted file mode 100644 index b329513..0000000 --- a/zchunk-0.9.13.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f95e26864e2e0c15b7ee7d15b2601bcad0401b3a748233ae663de34cda4d67cd -size 1420446 diff --git a/zchunk-1.0.2.tar.gz b/zchunk-1.0.2.tar.gz new file mode 100644 index 0000000..d310bcb --- /dev/null +++ b/zchunk-1.0.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:701e5f8b7ba655d3676f876a7b697ca8ce4d9e34f041f8b1d6d18e47c3dad966 +size 1449678 diff --git a/zchunk.changes b/zchunk.changes index c51c1a7..670fab6 100644 --- a/zchunk.changes +++ b/zchunk.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Wed Jan 23 10:38:19 UTC 2019 - Neal Gompa + +- Update to version 1.0.2 + + Use hash table for finding identical chunks, speeding up process + considerably + + Add test case to verify that identical chunk checking is working + +------------------------------------------------------------------- +Mon Dec 17 23:07:49 UTC 2018 - Neal Gompa + +- Update to version 0.9.17 + + Turn off some tests for big-endian architectures since zstd + isn't deterministic on them + + Add zck_gen_zdict binary to generate optimal zdict for a zchunk file + + Add functions to API to simplify extracting a single chunk + + Change default zstd compression to 9 for a 6x speed increase in + compression speed for a 5% increase in compression size + + Switch from optional flags to more robust optional elements + + Sanity check hex hashes passed in as an option + ------------------------------------------------------------------- Mon Oct 29 19:52:30 UTC 2018 - Luigi Baldoni diff --git a/zchunk.spec b/zchunk.spec index d95af88..17ca1df 100644 --- a/zchunk.spec +++ b/zchunk.spec @@ -2,7 +2,7 @@ # spec file for package zchunk # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2018 Neal Gompa . +# Copyright (c) 2019 Neal Gompa . # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %global devname libzck-devel Name: zchunk -Version: 0.9.13 +Version: 1.0.2 Release: 0 Summary: Compressed file format that allows easy deltas License: BSD-2-Clause AND MIT From 509c931d2e3f20a0577094d16f662fbe1c835b609c137ae0d40931cc925df5ff Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 24 Jan 2019 04:18:21 +0000 Subject: [PATCH 2/3] - Backport patch from upstream to fix bugs discovered by Coverity + Add patch: 0001-Fix-some-small-bugs-found-by-Coverity.patch OBS-URL: https://build.opensuse.org/package/show/Archiving/zchunk?expand=0&rev=16 --- ...ix-some-small-bugs-found-by-Coverity.patch | 63 +++++++++++++++++++ zchunk.changes | 6 ++ zchunk.spec | 2 + 3 files changed, 71 insertions(+) create mode 100644 0001-Fix-some-small-bugs-found-by-Coverity.patch diff --git a/0001-Fix-some-small-bugs-found-by-Coverity.patch b/0001-Fix-some-small-bugs-found-by-Coverity.patch new file mode 100644 index 0000000..e2bc6c8 --- /dev/null +++ b/0001-Fix-some-small-bugs-found-by-Coverity.patch @@ -0,0 +1,63 @@ +From 13b0e4d2068a3e4777ad431936910dd732e82dad Mon Sep 17 00:00:00 2001 +From: Jonathan Dieter +Date: Sat, 29 Dec 2018 12:25:44 +0000 +Subject: [PATCH] Fix some small bugs found by Coverity + +Signed-off-by: Jonathan Dieter +--- + src/lib/comp/comp.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/src/lib/comp/comp.c b/src/lib/comp/comp.c +index da0cfe1..89b3301 100644 +--- a/src/lib/comp/comp.c ++++ b/src/lib/comp/comp.c +@@ -479,8 +479,10 @@ ssize_t comp_read(zckCtx *zck, char *dst, size_t dst_size, bool use_dict) { + } + } + if(zck->comp.data_loc == zck->comp.data_idx->comp_length) { +- if(!comp_end_dchunk(zck, use_dict, zck->comp.data_idx->length)) ++ if(!comp_end_dchunk(zck, use_dict, zck->comp.data_idx->length)) { ++ free(src); + return -1; ++ } + if(zck->comp.data_idx == NULL) + zck->comp.data_eof = true; + continue; +@@ -659,10 +661,15 @@ ssize_t PUBLIC zck_get_chunk_comp_data(zckChunk *idx, char *dst, + /* Make sure chunk size is valid */ + if(zck_get_chunk_size(idx) < 0) + return -1; ++ + /* If the chunk is empty, we're done */ + if(zck_get_chunk_size(idx) == 0) + return 0; + ++ /* Make sure requested chunk has a beginning */ ++ if(zck_get_chunk_start(idx) < 0) ++ return -1; ++ + /* Seek to beginning of requested chunk */ + if(!seek_data(zck, zck_get_chunk_start(idx), SEEK_SET)) + return -1; +@@ -687,12 +694,17 @@ ssize_t PUBLIC zck_get_chunk_data(zckChunk *idx, char *dst, + /* If the chunk is empty, we're done */ + if(zck_get_chunk_size(idx) == 0) + return 0; ++ /* Make sure requested chunk has a beginning */ ++ if(zck_get_chunk_start(idx) < 0) ++ return -1; + + /* Read dictionary if needed */ + zckChunk *dict = zck_get_first_chunk(zck); + if(dict == NULL) + return -1; + if(zck_get_chunk_size(dict) > 0 && zck->comp.dict == NULL) { ++ if(zck_get_chunk_start(dict) < 0) ++ return -1; + if(!seek_data(zck, zck_get_chunk_start(dict), SEEK_SET)) + return -1; + if(!comp_reset(zck)) +-- +2.20.1 + diff --git a/zchunk.changes b/zchunk.changes index 670fab6..891262a 100644 --- a/zchunk.changes +++ b/zchunk.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 24 04:17:23 UTC 2019 - Neal Gompa + +- Backport patch from upstream to fix bugs discovered by Coverity + + Add patch: 0001-Fix-some-small-bugs-found-by-Coverity.patch + ------------------------------------------------------------------- Wed Jan 23 10:38:19 UTC 2019 - Neal Gompa diff --git a/zchunk.spec b/zchunk.spec index 17ca1df..45da541 100644 --- a/zchunk.spec +++ b/zchunk.spec @@ -29,6 +29,8 @@ License: BSD-2-Clause AND MIT Group: Productivity/Archiving/Compression URL: https://github.com/zchunk/zchunk Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +# Patches backported from upstream +Patch0001: 0001-Fix-some-small-bugs-found-by-Coverity.patch BuildRequires: meson >= 0.44.0 BuildRequires: pkgconfig BuildRequires: pkgconfig(libcurl) From 5d0b5bd225a7bad8c4f9e2247387399c8bbf26b1a39bd612cf234f670823b426 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 24 Jan 2019 20:58:15 +0000 Subject: [PATCH 3/3] - Update to version 1.0.3 + Fix some small bugs found by Coverity + Fix memory leak and off-by-one errors - Drop patches part of 1.0.3 release + 0001-Fix-some-small-bugs-found-by-Coverity.patch OBS-URL: https://build.opensuse.org/package/show/Archiving/zchunk?expand=0&rev=17 --- ...ix-some-small-bugs-found-by-Coverity.patch | 63 ------------------- zchunk-1.0.2.tar.gz | 3 - zchunk-1.0.3.tar.gz | 3 + zchunk.changes | 9 +++ zchunk.spec | 4 +- 5 files changed, 13 insertions(+), 69 deletions(-) delete mode 100644 0001-Fix-some-small-bugs-found-by-Coverity.patch delete mode 100644 zchunk-1.0.2.tar.gz create mode 100644 zchunk-1.0.3.tar.gz diff --git a/0001-Fix-some-small-bugs-found-by-Coverity.patch b/0001-Fix-some-small-bugs-found-by-Coverity.patch deleted file mode 100644 index e2bc6c8..0000000 --- a/0001-Fix-some-small-bugs-found-by-Coverity.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 13b0e4d2068a3e4777ad431936910dd732e82dad Mon Sep 17 00:00:00 2001 -From: Jonathan Dieter -Date: Sat, 29 Dec 2018 12:25:44 +0000 -Subject: [PATCH] Fix some small bugs found by Coverity - -Signed-off-by: Jonathan Dieter ---- - src/lib/comp/comp.c | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) - -diff --git a/src/lib/comp/comp.c b/src/lib/comp/comp.c -index da0cfe1..89b3301 100644 ---- a/src/lib/comp/comp.c -+++ b/src/lib/comp/comp.c -@@ -479,8 +479,10 @@ ssize_t comp_read(zckCtx *zck, char *dst, size_t dst_size, bool use_dict) { - } - } - if(zck->comp.data_loc == zck->comp.data_idx->comp_length) { -- if(!comp_end_dchunk(zck, use_dict, zck->comp.data_idx->length)) -+ if(!comp_end_dchunk(zck, use_dict, zck->comp.data_idx->length)) { -+ free(src); - return -1; -+ } - if(zck->comp.data_idx == NULL) - zck->comp.data_eof = true; - continue; -@@ -659,10 +661,15 @@ ssize_t PUBLIC zck_get_chunk_comp_data(zckChunk *idx, char *dst, - /* Make sure chunk size is valid */ - if(zck_get_chunk_size(idx) < 0) - return -1; -+ - /* If the chunk is empty, we're done */ - if(zck_get_chunk_size(idx) == 0) - return 0; - -+ /* Make sure requested chunk has a beginning */ -+ if(zck_get_chunk_start(idx) < 0) -+ return -1; -+ - /* Seek to beginning of requested chunk */ - if(!seek_data(zck, zck_get_chunk_start(idx), SEEK_SET)) - return -1; -@@ -687,12 +694,17 @@ ssize_t PUBLIC zck_get_chunk_data(zckChunk *idx, char *dst, - /* If the chunk is empty, we're done */ - if(zck_get_chunk_size(idx) == 0) - return 0; -+ /* Make sure requested chunk has a beginning */ -+ if(zck_get_chunk_start(idx) < 0) -+ return -1; - - /* Read dictionary if needed */ - zckChunk *dict = zck_get_first_chunk(zck); - if(dict == NULL) - return -1; - if(zck_get_chunk_size(dict) > 0 && zck->comp.dict == NULL) { -+ if(zck_get_chunk_start(dict) < 0) -+ return -1; - if(!seek_data(zck, zck_get_chunk_start(dict), SEEK_SET)) - return -1; - if(!comp_reset(zck)) --- -2.20.1 - diff --git a/zchunk-1.0.2.tar.gz b/zchunk-1.0.2.tar.gz deleted file mode 100644 index d310bcb..0000000 --- a/zchunk-1.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:701e5f8b7ba655d3676f876a7b697ca8ce4d9e34f041f8b1d6d18e47c3dad966 -size 1449678 diff --git a/zchunk-1.0.3.tar.gz b/zchunk-1.0.3.tar.gz new file mode 100644 index 0000000..450c53d --- /dev/null +++ b/zchunk-1.0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:728a2fe91057be0646d430cbbf90b8d85e68995e61c27feda311421b51d88298 +size 1449680 diff --git a/zchunk.changes b/zchunk.changes index 891262a..39756b9 100644 --- a/zchunk.changes +++ b/zchunk.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Jan 24 20:54:12 UTC 2019 - Neal Gompa + +- Update to version 1.0.3 + + Fix some small bugs found by Coverity + + Fix memory leak and off-by-one errors +- Drop patches part of 1.0.3 release + + 0001-Fix-some-small-bugs-found-by-Coverity.patch + ------------------------------------------------------------------- Thu Jan 24 04:17:23 UTC 2019 - Neal Gompa diff --git a/zchunk.spec b/zchunk.spec index 45da541..1070ab6 100644 --- a/zchunk.spec +++ b/zchunk.spec @@ -22,15 +22,13 @@ %global devname libzck-devel Name: zchunk -Version: 1.0.2 +Version: 1.0.3 Release: 0 Summary: Compressed file format that allows easy deltas License: BSD-2-Clause AND MIT Group: Productivity/Archiving/Compression URL: https://github.com/zchunk/zchunk Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -# Patches backported from upstream -Patch0001: 0001-Fix-some-small-bugs-found-by-Coverity.patch BuildRequires: meson >= 0.44.0 BuildRequires: pkgconfig BuildRequires: pkgconfig(libcurl)