Skip to content

Commit 1c5ebee

Browse files
Patch libtiff for CVE-2025-8534
1 parent 0c9474d commit 1c5ebee

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

SPECS/libtiff/CVE-2025-8534.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 181b242df620a164fa9ee669c6f77bd53661130f Mon Sep 17 00:00:00 2001
2+
From: Su_Laus <[email protected]>
3+
Date: Sat, 2 Aug 2025 18:55:54 +0200
4+
Subject: [PATCH] tiff2ps: check return of TIFFGetFiled() for
5+
TIFFTAG_STRIPBYTECOUNTS and TIFFTAG_TILEBYTECOUNTS to avoid NULL pointer
6+
dereference.
7+
8+
Closes #718
9+
---
10+
tools/unsupported/tiff2ps.c | 20 +++++++++++++++++---
11+
1 file changed, 17 insertions(+), 3 deletions(-)
12+
13+
diff --git a/tools/unsupported/tiff2ps.c b/tools/unsupported/tiff2ps.c
14+
index 541495d..d6a54b4 100644
15+
--- a/tools/unsupported/tiff2ps.c
16+
+++ b/tools/unsupported/tiff2ps.c
17+
@@ -2432,12 +2432,22 @@ int PS_Lvl2page(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
18+
if (tiled_image)
19+
{
20+
num_chunks = TIFFNumberOfTiles(tif);
21+
- TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc);
22+
+ if (!TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &bc))
23+
+ {
24+
+ TIFFError(filename,
25+
+ "Can't read bytecounts of tiles at PS_Lvl2page()");
26+
+ return (FALSE);
27+
+ }
28+
}
29+
else
30+
{
31+
num_chunks = TIFFNumberOfStrips(tif);
32+
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
33+
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
34+
+ {
35+
+ TIFFError(filename,
36+
+ "Can't read bytecounts of strips at PS_Lvl2page()");
37+
+ return (FALSE);
38+
+ }
39+
}
40+
41+
if (use_rawdata)
42+
@@ -3107,7 +3117,11 @@ void PSRawDataBW(FILE *fd, TIFF *tif, uint32_t w, uint32_t h)
43+
(void)w;
44+
(void)h;
45+
TIFFGetFieldDefaulted(tif, TIFFTAG_FILLORDER, &fillorder);
46+
- TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc);
47+
+ if (!TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &bc))
48+
+ {
49+
+ TIFFError(filename, "Can't read bytecounts of strips at PSRawDataBW()");
50+
+ return;
51+
+ }
52+
53+
/*
54+
* Find largest strip:
55+
--
56+
2.45.4
57+

SPECS/libtiff/libtiff.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: TIFF libraries and associated utilities.
22
Name: libtiff
33
Version: 4.6.0
4-
Release: 6%{?dist}
4+
Release: 7%{?dist}
55
License: libtiff
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -13,6 +13,7 @@ Patch1: CVE-2023-6277.patch
1313
Patch2: CVE-2024-7006.patch
1414
Patch3: CVE-2023-3164.patch
1515
Patch4: CVE-2023-6228.patch
16+
Patch5: CVE-2025-8534.patch
1617

1718
BuildRequires: autoconf
1819
BuildRequires: automake
@@ -66,6 +67,9 @@ make %{?_smp_mflags} -k check
6667
%{_docdir}/*
6768

6869
%changelog
70+
* Tue Aug 05 2025 Azure Linux Security Servicing Account <[email protected]> - 4.6.0-7
71+
- Patch for CVE-2025-8534
72+
6973
* Mon Feb 03 2025 Ankita Pareek <[email protected]> - 4.6.0-6
7074
- Address CVE-2023-6228 with a patch
7175

0 commit comments

Comments
 (0)