summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/tiff/CVE-2025-9165.patch
blob: 560229284c9bc9194b73c9cd661cfaa8084f1d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From ed141286a37f6e5ddafb5069347ff5d587e7a4e0 Mon Sep 17 00:00:00 2001
From: Su_Laus <sulau@freenet.de>
Date: Fri, 8 Aug 2025 21:35:30 +0200
Subject: [PATCH] tiffcmp: fix memory leak when second file cannot be opened.

Closes #728, #729

CVE: CVE-2025-9165
Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/ed141286a37f6e5ddafb5069347ff5d587e7a4e0]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 tools/tiffcmp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/tiffcmp.c b/tools/tiffcmp.c
index 529c1cdc..88d9470f 100644
--- a/tools/tiffcmp.c
+++ b/tools/tiffcmp.c
@@ -105,7 +105,10 @@ int main(int argc, char *argv[])
         return (2);
     tif2 = TIFFOpen(argv[optind + 1], "r");
     if (tif2 == NULL)
+    {
+        TIFFClose(tif1);
         return (2);
+    }
     dirnum = 0;
     while (tiffcmp(tif1, tif2))
     {