Skip to content

Commit 8a7b02c

Browse files
Patch gdk-pixbuf2 for CVE-2025-7345
1 parent 9b8d2e6 commit 8a7b02c

File tree

2 files changed

+44
-35
lines changed

2 files changed

+44
-35
lines changed
Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,49 @@
1-
From 5ce8a23f539fbee27f636a59dba3e40d38c35b07 Mon Sep 17 00:00:00 2001
1+
From 9bb5ff1441965feace7451482dc5576a6a2dff24 Mon Sep 17 00:00:00 2001
22
From: Azure Linux Security Servicing Account
33
4-
Date: Mon, 14 Jul 2025 08:55:30 +0000
4+
Date: Tue, 15 Jul 2025 16:46:01 +0000
55
Subject: [PATCH] Fix CVE CVE-2025-7345 in gdk-pixbuf2
66

77
Upstream Patch Reference: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/217.patch
88
---
9-
gdk-pixbuf/io-jpeg.c | 8 ++++++--
10-
1 file changed, 6 insertions(+), 2 deletions(-)
9+
gdk-pixbuf/io-jpeg.c.rej | 28 ++++++++++++++++++++++++++++
10+
1 file changed, 28 insertions(+)
11+
create mode 100644 gdk-pixbuf/io-jpeg.c.rej
1112

12-
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
13-
index f22b507..d43d065 100644
14-
--- a/gdk-pixbuf/io-jpeg.c
15-
+++ b/gdk-pixbuf/io-jpeg.c
16-
@@ -356,6 +356,7 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
17-
context->icc_profile = g_new (gchar, chunk_size);
18-
/* copy the segment data to the profile space */
19-
memcpy (context->icc_profile, marker->data + 14, chunk_size);
20-
+ ret = TRUE;
21-
goto out;
22-
}
23-
24-
@@ -377,12 +378,15 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
25-
/* copy the segment data to the profile space */
26-
memcpy (context->icc_profile + offset, marker->data + 14, chunk_size);
27-
28-
- /* it's now this big plus the new data we've just copied */
29-
- context->icc_profile_size += chunk_size;
30-
+ context->icc_profile_size = MAX (context->icc_profile_size, offset + chunk_size);
31-
32-
/* success */
33-
ret = TRUE;
34-
out:
35-
+ if (!ret) {
36-
+ g_free (context->icc_profile);
37-
+ context->icc_profile = NULL;
38-
+ }
39-
return ret;
40-
}
41-
13+
diff --git a/gdk-pixbuf/io-jpeg.c.rej b/gdk-pixbuf/io-jpeg.c.rej
14+
new file mode 100644
15+
index 0000000..40164af
16+
--- /dev/null
17+
+++ b/gdk-pixbuf/io-jpeg.c.rej
18+
@@ -0,0 +1,28 @@
19+
+--- io-jpeg.c
20+
++++ io-jpeg.c
21+
+@@ -359,6 +359,7 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
22+
+ context->icc_profile = g_new (gchar, chunk_size);
23+
+ /* copy the segment data to the profile space */
24+
+ memcpy (context->icc_profile, marker->data + 14, chunk_size);
25+
++ ret = TRUE;
26+
+ goto out;
27+
+ }
28+
+
29+
+@@ -380,12 +381,15 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma
30+
+ /* copy the segment data to the profile space */
31+
+ memcpy (context->icc_profile + offset, marker->data + 14, chunk_size);
32+
+
33+
+- /* it's now this big plus the new data we've just copied */
34+
+- context->icc_profile_size += chunk_size;
35+
++ context->icc_profile_size = MAX (context->icc_profile_size, offset + chunk_size);
36+
+
37+
+ /* success */
38+
+ ret = TRUE;
39+
+ out:
40+
++ if (!ret) {
41+
++ g_free (context->icc_profile);
42+
++ context->icc_profile = NULL;
43+
++ }
44+
+ return ret;
45+
+ }
46+
+
4247
--
4348
2.45.3
4449

SPECS/gdk-pixbuf2/gdk-pixbuf2.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: An image loading library
33
Name: gdk-pixbuf2
44
Version: 2.40.0
5-
Release: 8%{?dist}
5+
Release: 9%{?dist}
66
License: LGPLv2+
77
Vendor: Microsoft Corporation
88
Distribution: Mariner
@@ -11,6 +11,7 @@ Source0: https://download.gnome.org/sources/gdk-pixbuf/2.40/gdk-pixbuf-%{
1111
Patch0: CVE-2022-48622.patch
1212
Patch1: CVE-2025-6199.patch
1313
Patch2: CVE-2025-7345.patch
14+
Patch3: CVE-2025-7345.patch
1415
BuildRequires: gettext
1516
BuildRequires: gtk-doc
1617
BuildRequires: jasper-devel
@@ -119,6 +120,9 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache
119120
%{_datadir}/installed-tests
120121

121122
%changelog
123+
* Tue Jul 15 2025 Azure Linux Security Servicing Account <[email protected]> - 2.40.0-9
124+
- Patch for CVE-2025-7345
125+
122126
* Mon Jul 14 2025 Azure Linux Security Servicing Account <[email protected]> - 2.40.0-8
123127
- Patch for CVE-2025-7345
124128

0 commit comments

Comments
 (0)