Skip to content

Commit bfd88b5

Browse files
[AutoPR- Security] Patch libexif for CVE-2026-32775 [MEDIUM] (#16236)
1 parent 6218737 commit bfd88b5

2 files changed

Lines changed: 92 additions & 1 deletion

File tree

SPECS/libexif/CVE-2026-32775.patch

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
From 7e6c660a540fe0231bdd43017686211a9eacac8b Mon Sep 17 00:00:00 2001
2+
From: Marcus Meissner <marcus@jet.franken.de>
3+
Date: Mon, 9 Mar 2026 10:02:53 +0100
4+
Subject: [PATCH] check maxlen to be at least 1
5+
6+
maxlen-- on 0 will become a high value.
7+
8+
(likely found by AI)
9+
10+
Fixes https://github.com/libexif/libexif/issues/247
11+
12+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
13+
Upstream-reference: https://github.com/libexif/libexif/commit/7df372e9d31d7c993a22b913c813a5f7ec4f3692.patch
14+
---
15+
libexif/apple/mnote-apple-entry.c | 2 ++
16+
libexif/canon/mnote-canon-entry.c | 2 ++
17+
libexif/fuji/mnote-fuji-entry.c | 1 +
18+
libexif/olympus/mnote-olympus-entry.c | 2 ++
19+
libexif/pentax/mnote-pentax-entry.c | 1 +
20+
5 files changed, 8 insertions(+)
21+
22+
diff --git a/libexif/apple/mnote-apple-entry.c b/libexif/apple/mnote-apple-entry.c
23+
index 6740d8e..337e51b 100644
24+
--- a/libexif/apple/mnote-apple-entry.c
25+
+++ b/libexif/apple/mnote-apple-entry.c
26+
@@ -43,6 +43,8 @@ mnote_apple_entry_get_value(MnoteAppleEntry *entry, char *v, unsigned int maxlen
27+
28+
if (!entry)
29+
return NULL;
30+
+ if (maxlen < 1)
31+
+ return NULL;
32+
33+
memset(v, 0, maxlen);
34+
maxlen--;
35+
diff --git a/libexif/canon/mnote-canon-entry.c b/libexif/canon/mnote-canon-entry.c
36+
index 52a7077..372fcdf 100644
37+
--- a/libexif/canon/mnote-canon-entry.c
38+
+++ b/libexif/canon/mnote-canon-entry.c
39+
@@ -559,6 +559,8 @@ mnote_canon_entry_get_value (const MnoteCanonEntry *entry, unsigned int t, char
40+
41+
if (!entry)
42+
return NULL;
43+
+ if (maxlen < 1)
44+
+ return NULL;
45+
46+
data = entry->data;
47+
size = entry->size;
48+
diff --git a/libexif/fuji/mnote-fuji-entry.c b/libexif/fuji/mnote-fuji-entry.c
49+
index add7086..dd33900 100644
50+
--- a/libexif/fuji/mnote-fuji-entry.c
51+
+++ b/libexif/fuji/mnote-fuji-entry.c
52+
@@ -199,6 +199,7 @@ mnote_fuji_entry_get_value (MnoteFujiEntry *entry,
53+
int i, j;
54+
55+
if (!entry) return (NULL);
56+
+ if (maxlen < 1) return NULL;
57+
58+
memset (val, 0, maxlen);
59+
maxlen--;
60+
diff --git a/libexif/olympus/mnote-olympus-entry.c b/libexif/olympus/mnote-olympus-entry.c
61+
index 679fb50..d5eb60e 100644
62+
--- a/libexif/olympus/mnote-olympus-entry.c
63+
+++ b/libexif/olympus/mnote-olympus-entry.c
64+
@@ -284,6 +284,8 @@ mnote_olympus_entry_get_value (MnoteOlympusEntry *entry, char *v, unsigned int m
65+
66+
if (!entry)
67+
return (NULL);
68+
+ if (maxlen < 1)
69+
+ return NULL;
70+
71+
memset (v, 0, maxlen);
72+
maxlen--;
73+
diff --git a/libexif/pentax/mnote-pentax-entry.c b/libexif/pentax/mnote-pentax-entry.c
74+
index 32b537b..d3c96f8 100644
75+
--- a/libexif/pentax/mnote-pentax-entry.c
76+
+++ b/libexif/pentax/mnote-pentax-entry.c
77+
@@ -315,6 +315,7 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry,
78+
int i = 0, j = 0;
79+
80+
if (!entry) return (NULL);
81+
+ if (maxlen < 1) return (NULL);
82+
83+
memset (val, 0, maxlen);
84+
maxlen--;
85+
--
86+
2.45.4
87+

SPECS/libexif/libexif.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Summary: Library for extracting extra information from image files
22
Name: libexif
33
Version: 0.6.24
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: LGPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Mariner
88
URL: https://libexif.github.io/
99
Source0: https://github.com/libexif/libexif/releases/download/v%{version}/%{name}-%{version}.tar.bz2
10+
Patch0: CVE-2026-32775.patch
1011
BuildRequires: doxygen
1112
BuildRequires: gcc
1213
BuildRequires: gettext-devel
@@ -70,6 +71,9 @@ iconv -f latin1 -t utf-8 < README > README.utf8; cp README.utf8 README
7071
%doc libexif-api.html
7172

7273
%changelog
74+
* Thu Mar 19 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 0.6.24-2
75+
- Patch for CVE-2026-32775
76+
7377
* Mon Jul 11 2022 Olivia Crain <oliviacrain@microsoft.com> - 0.6.24-1
7478
- Upgrade to latest upstream version
7579
- Promote to mariner-official-base repo

0 commit comments

Comments
 (0)