libtiff/0043-CVE-2023-6228-Merge-branch-fix_606_tiffcp_check_also.patch
Matej Mužila 44e09a0bb8 Fix CVE-2023-6228 CVE-2023-52356 CVE-2023-25433 CVE-2018-15209
Resolves: RHEL-30682 RHEL-30520 RHEL-30474 RHEL-5406
2024-05-16 16:31:19 +02:00

31 lines
1.0 KiB
Diff

From 32346d49db890969d7de19e8eebff00400280926 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Sat, 9 Sep 2023 15:11:42 +0000
Subject: [PATCH] (CVE-2023-6228) Merge branch
'fix_606_tiffcp_check_also_input_compression_codec' into 'master'
tiffcp: Fixes #606. Check also codec of input image, not only from output image.
Closes #606
See merge request libtiff/libtiff!533
(cherry picked from commit 668d2c1a52fa48658bbf69615924b42b5a059f9e)
---
tools/tiffcp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/tiffcp.c b/tools/tiffcp.c
index fb98bd57..81ec6bbd 100644
--- a/tools/tiffcp.c
+++ b/tools/tiffcp.c
@@ -622,6 +622,8 @@ tiffcp(TIFF* in, TIFF* out)
else
CopyField(TIFFTAG_COMPRESSION, compression);
TIFFGetFieldDefaulted(in, TIFFTAG_COMPRESSION, &input_compression);
+ if (!TIFFIsCODECConfigured(input_compression))
+ return FALSE;
TIFFGetFieldDefaulted(in, TIFFTAG_PHOTOMETRIC, &input_photometric);
if (input_compression == COMPRESSION_JPEG) {
/* Force conversion to RGB */