!6 Fix invalid read outsize allocated memory
From: @ultra_planet Reviewed-by: @licihua Signed-off-by: @licihua
This commit is contained in:
commit
5738aeddcc
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
|
||||
Version: 1.0.1
|
||||
Release: 8
|
||||
Release: 9
|
||||
Summary: Compression library programmed in C
|
||||
License: ASL 2.0
|
||||
URL: https://github.com/google/zopfli
|
||||
Source0: https://github.com/google/zopfli/archive/zopfli-%{version}.tar.gz
|
||||
BuildRequires: gcc-c++
|
||||
|
||||
Patch0001: Fix-invalid-read-outsize-allocated-memory.patch
|
||||
|
||||
%description
|
||||
Zopfli Compression Algorithm is a compression library programmed in C to perform
|
||||
very good, but slow, deflate or zlib compression.
|
||||
|
||||
%prep
|
||||
%autosetup -n zopfli-zopfli-%{version}
|
||||
%autosetup -n zopfli-zopfli-%{version} -p1
|
||||
|
||||
%build
|
||||
cflags=`sed -n '/^CFLAGS/=' Makefile`
|
||||
@ -33,5 +35,8 @@ chmod 0755 %{buildroot}%{_bindir}/zopfli*
|
||||
|
||||
|
||||
%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
|
||||
- Package init
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
version_control: github
|
||||
src_repo: google/zopfli
|
||||
tag_prefix: zopfli-
|
||||
seperator: .
|
||||
tag_prefix: "^zopfli-"
|
||||
separator: "."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user