Blame SOURCES/0034-CVE-2022-2519-CVE-2022-2520-CVE-2022-2521-CVE-2022-2.patch

b45dc8
From 3635844b59578eb572372e7546548ea84c967ba1 Mon Sep 17 00:00:00 2001
b45dc8
From: Su_Laus <sulau@freenet.de>
b45dc8
Date: Sat, 20 Aug 2022 23:35:26 +0200
b45dc8
Subject: [PATCH] (CVE-2022-2519 CVE-2022-2520 CVE-2022-2521 CVE-2022-2953)
b45dc8
 tiffcrop -S option: Make decision simpler.
b45dc8
b45dc8
(cherry picked from commit bad48e90b410df32172006c7876da449ba62cdba)
b45dc8
---
b45dc8
 tools/tiffcrop.c | 10 +++++-----
b45dc8
 1 file changed, 5 insertions(+), 5 deletions(-)
b45dc8
b45dc8
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
b45dc8
index 27e6f81c..ff118496 100644
b45dc8
--- a/tools/tiffcrop.c
b45dc8
+++ b/tools/tiffcrop.c
b45dc8
@@ -2106,11 +2106,11 @@ void  process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
b45dc8
     }
b45dc8
     /*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/
b45dc8
     char XY, Z, R, S;
b45dc8
-    XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH));
b45dc8
-    Z = (crop_data->crop_mode & CROP_ZONES);
b45dc8
-    R = (crop_data->crop_mode & CROP_REGIONS);
b45dc8
-    S = (page->mode & PAGE_MODE_ROWSCOLS);
b45dc8
-    if ((XY && Z) || (XY && R) || (XY && S) || (Z && R) || (Z && S) || (R && S)) {
b45dc8
+    XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH)) ? 1 : 0;
b45dc8
+    Z = (crop_data->crop_mode & CROP_ZONES) ? 1 : 0;
b45dc8
+    R = (crop_data->crop_mode & CROP_REGIONS) ? 1 : 0;
b45dc8
+    S = (page->mode & PAGE_MODE_ROWSCOLS) ? 1 : 0;
b45dc8
+    if (XY + Z + R + S > 1) {
b45dc8
         TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit");
b45dc8
         exit(EXIT_FAILURE);
b45dc8
     }