Bzip2recover: off by one error

Resolves: RHEL-36503
This commit is contained in:
Jakub Martisko 2024-12-03 11:09:33 +01:00
parent a39f992cf5
commit 1daa00dbff
2 changed files with 18 additions and 1 deletions

11
bzip2-6.0-sast.patch Normal file
View File

@ -0,0 +1,11 @@
--- ./bzip2recover.c.old 2024-12-03 11:00:07.024976697 +0100
+++ ./bzip2recover.c 2024-12-03 11:02:28.832219809 +0100
@@ -402,7 +402,7 @@
rbEnd[rbCtr] = bEnd[currBlock];
rbCtr++;
}
- if (currBlock >= BZ_MAX_HANDLED_BLOCKS)
+ if (currBlock >= (BZ_MAX_HANDLED_BLOCKS-1))
tooManyBlocks(BZ_MAX_HANDLED_BLOCKS);
currBlock++;

View File

@ -3,7 +3,7 @@
Summary: File compression utility
Name: bzip2
Version: 1.0.8
Release: 23%{?dist}
Release: 24%{?dist}
License: BSD-4-Clause
URL: https://sourceware.org/bzip2
#Source0: http://www.bzip.org/%{version}/%{name}-%{version}.tar.gz
@ -20,6 +20,7 @@ Patch1: bzip2-cflags.patch
Patch2: bzip2-ldflags.patch
Patch3: man_gzipdiff.patch
Patch4: bzip2-out_of_bounds.patch
Patch5: bzip2-6.0-sast.patch
BuildRequires: gcc
BuildRequires: make
@ -65,6 +66,7 @@ Static libraries for applications using the bzip2 compression format.
%patch 2 -p1
%patch 3 -p2
%patch 4 -p1
%patch 5 -p1
cp -a %{SOURCE1} .
sed -i "s|^libdir=|libdir=%{_libdir}|" bzip2.pc
@ -131,6 +133,10 @@ ln -s bzgrep.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzfgrep.1
%{_libdir}/pkgconfig/bzip2.pc
%changelog
* Tue Dec 03 2024 Jakub Martisko <jamartis@redhat.com> - 1.0.8-24
- Fix an off by one error in bzip2recover.c
Resolves: RHEL-36503
* Tue Dec 03 2024 Jakub Martisko <jamartis@redhat.com> - 1.0.8-23
- Fix out of bounds write in bz_decompress
Resolves: CVE-2019-12900