Fix invalid read outsize allocated memory
This commit is contained in:
parent
aea45a11b1
commit
c6c0aab3cf
23
Fix-invalid-read-outsize-allocated-memory.patch
Normal file
23
Fix-invalid-read-outsize-allocated-memory.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From 9429e20de3885c0e0d9beac23f703fce58461021 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Szabolcs Berecz <szabolcs.berecz@gmail.com>
|
||||||
|
Date: Sun, 25 Oct 2015 22:43:25 +0100
|
||||||
|
Subject: [PATCH] Fix invalid read outsize allocated memory
|
||||||
|
|
||||||
|
The invalid read happens when compressing a 1 byte file.
|
||||||
|
---
|
||||||
|
src/zopfli/hash.c | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/zopfli/hash.c b/src/zopfli/hash.c
|
||||||
|
index a3b294fa..66528aa5 100644
|
||||||
|
--- a/src/zopfli/hash.c
|
||||||
|
+++ b/src/zopfli/hash.c
|
||||||
|
@@ -129,7 +129,6 @@ void ZopfliUpdateHash(const unsigned char* array, size_t pos, size_t end,
|
||||||
|
|
||||||
|
void ZopfliWarmupHash(const unsigned char* array, size_t pos, size_t end,
|
||||||
|
ZopfliHash* h) {
|
||||||
|
- (void)end;
|
||||||
|
UpdateHashValue(h, array[pos + 0]);
|
||||||
|
- UpdateHashValue(h, array[pos + 1]);
|
||||||
|
+ if (pos + 1 < end) UpdateHashValue(h, array[pos + 1]);
|
||||||
|
}
|
||||||
@ -1,18 +1,20 @@
|
|||||||
Name: zopfli
|
Name: zopfli
|
||||||
Version: 1.0.1
|
Version: 1.0.1
|
||||||
Release: 8
|
Release: 9
|
||||||
Summary: Compression library programmed in C
|
Summary: Compression library programmed in C
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
URL: https://github.com/google/zopfli
|
URL: https://github.com/google/zopfli
|
||||||
Source0: https://github.com/google/zopfli/archive/zopfli-%{version}.tar.gz
|
Source0: https://github.com/google/zopfli/archive/zopfli-%{version}.tar.gz
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
|
||||||
|
Patch0001: Fix-invalid-read-outsize-allocated-memory.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Zopfli Compression Algorithm is a compression library programmed in C to perform
|
Zopfli Compression Algorithm is a compression library programmed in C to perform
|
||||||
very good, but slow, deflate or zlib compression.
|
very good, but slow, deflate or zlib compression.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n zopfli-zopfli-%{version}
|
%autosetup -n zopfli-zopfli-%{version} -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cflags=`sed -n '/^CFLAGS/=' Makefile`
|
cflags=`sed -n '/^CFLAGS/=' Makefile`
|
||||||
@ -33,5 +35,8 @@ chmod 0755 %{buildroot}%{_bindir}/zopfli*
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Nov 26 2020 lingsheng <lingsheng@huawei.com> - 1.0.1-9
|
||||||
|
- Fix invalid read outsize allocated memory
|
||||||
|
|
||||||
* Mon Jan 6 2020 zhujunhao <zhujunhao5@huawei.com> - 1.0.1-8
|
* Mon Jan 6 2020 zhujunhao <zhujunhao5@huawei.com> - 1.0.1-8
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
version_control: github
|
version_control: github
|
||||||
src_repo: google/zopfli
|
src_repo: google/zopfli
|
||||||
tag_prefix: zopfli-
|
tag_prefix: "^zopfli-"
|
||||||
seperator: .
|
separator: "."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user