Fix CVE-2026-2050

This commit is contained in:
Andrew Lukoshko 2026-08-12 10:20:50 +00:00
parent cc0b500c72
commit 40d8a8557e
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From ea7921795ee5d90f42ca8f829fdbd0a5c6c560ca Mon Sep 17 00:00:00 2001
From: Gabriele Barbero <barbero.gabriele03@gmail.com>
Date: Fri, 5 Dec 2025 00:20:22 +0100
Subject: [PATCH] ZDI-CAN-28266: guard against buffer overflow
In rgbe_read_new_rle we check whether there is still space in the buffer,
but we do not verify that the run length fits within the remaining capacity.
This can lead to a buffer overflow. This patch adds a check to ensure that
the run length does not exceed the available space.
---
libs/rgbe/rgbe.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/libs/rgbe/rgbe.c b/libs/rgbe/rgbe.c
index eedde2660..2f52fb18b 100644
--- a/libs/rgbe/rgbe.c
+++ b/libs/rgbe/rgbe.c
@@ -670,6 +670,13 @@ rgbe_read_new_rle (const rgbe_file *file,
data++;
+ /* Check if there's enought space in the buffer to avoid OOB */
+ if (length > (pixels + RGBE_NUM_RGBE * linesize - pixoffset[component]) / RGBE_NUM_RGBE)
+ {
+ g_warning ("Buffer overflow detected.");
+ return FALSE;
+ }
+
/* A compressed run */
if (rle)
{
--
2.52.0

View File

@ -2,7 +2,7 @@
Name: gegl04
Version: 0.4.62
Release: 1%{?dist}
Release: 1%{?dist}.1
Summary: Graph based image processing framework
# The binary is under the GPL, while the libs are under LGPL.
@ -13,6 +13,8 @@ Source0: http://download.gimp.org/pub/gegl/%{apiver}/gegl-%{version}.tar.
Patch0: gegl04-openexr.patch
Patch1: gegl04-gtk.patch
# https://github.com/GNOME/gegl/commit/d32f1badb4bde1d6e8137f687d9ee1195768d4ed
Patch2: gegl04-CVE-2026-2050.patch
BuildRequires: chrpath
BuildRequires: enscript
@ -174,6 +176,9 @@ chrpath --delete %{buildroot}%{_libdir}/gegl-%{apiver}/*.so
%changelog
* Mon Jul 13 2026 Josef Ridky <jridky@redhat.com> - 0.4.62-1.1
- Fix CVE-2026-2050 (RHEL-188266)
* Tue May 20 2025 Josef Ridky <jridky@redhat.com> - 0.4.62-1
- New upstream release 0.4.62 (RHEL-88143)