arp-scan: update to 1.10.0
[feed/packages.git] / libs / tiff / patches / 010-CVE-2022-2519.patch
1 From 8fe3735942ea1d90d8cef843b55b3efe8ab6feaf Mon Sep 17 00:00:00 2001
2 From: Su_Laus <sulau@freenet.de>
3 Date: Mon, 15 Aug 2022 22:11:03 +0200
4 Subject: [PATCH] =?UTF-8?q?According=20to=20Richard=20Nolde=20https://gitl?=
5 =?UTF-8?q?ab.com/libtiff/libtiff/-/issues/401#note=5F877637400=20the=20ti?=
6 =?UTF-8?q?ffcrop=20option=20=E2=80=9E-S=E2=80=9C=20is=20also=20mutually?=
7 =?UTF-8?q?=20exclusive=20to=20the=20other=20crop=20options=20(-X|-Y),=20-?=
8 =?UTF-8?q?Z=20and=20-z.?=
9 MIME-Version: 1.0
10 Content-Type: text/plain; charset=UTF-8
11 Content-Transfer-Encoding: 8bit
12
13 This is now checked and ends tiffcrop if those arguments are not mutually exclusive.
14
15 This MR will fix the following tiffcrop issues: #349, #414, #422, #423, #424
16 ---
17 tools/tiffcrop.c | 31 ++++++++++++++++---------------
18 1 file changed, 16 insertions(+), 15 deletions(-)
19
20 --- a/tools/tiffcrop.c
21 +++ b/tools/tiffcrop.c
22 @@ -108,12 +108,12 @@
23 * lower level, scanline level routines. Debug reports a limited set
24 * of messages to monitor progress without enabling dump logs.
25 *
26 - * Note: The (-X|-Y), -Z and -z options are mutually exclusive.
27 + * Note: The (-X|-Y), -Z, -z and -S options are mutually exclusive.
28 * In no case should the options be applied to a given selection successively.
29 */
30
31 -static char tiffcrop_version_id[] = "2.5";
32 -static char tiffcrop_rev_date[] = "02-09-2022";
33 +static char tiffcrop_version_id[] = "2.5.1";
34 +static char tiffcrop_rev_date[] = "15-08-2022";
35
36 #include "tif_config.h"
37 #include "libport.h"
38 @@ -173,12 +173,12 @@ static char tiffcrop_rev_date[] = "02-
39 #define ROTATECW_270 32
40 #define ROTATE_ANY (ROTATECW_90 | ROTATECW_180 | ROTATECW_270)
41
42 -#define CROP_NONE 0
43 -#define CROP_MARGINS 1
44 -#define CROP_WIDTH 2
45 -#define CROP_LENGTH 4
46 -#define CROP_ZONES 8
47 -#define CROP_REGIONS 16
48 +#define CROP_NONE 0 /* "-S" -> Page_MODE_ROWSCOLS and page->rows/->cols != 0 */
49 +#define CROP_MARGINS 1 /* "-m" */
50 +#define CROP_WIDTH 2 /* "-X" */
51 +#define CROP_LENGTH 4 /* "-Y" */
52 +#define CROP_ZONES 8 /* "-Z" */
53 +#define CROP_REGIONS 16 /* "-z" */
54 #define CROP_ROTATE 32
55 #define CROP_MIRROR 64
56 #define CROP_INVERT 128
57 @@ -316,7 +316,7 @@ struct crop_mask {
58 #define PAGE_MODE_RESOLUTION 1
59 #define PAGE_MODE_PAPERSIZE 2
60 #define PAGE_MODE_MARGINS 4
61 -#define PAGE_MODE_ROWSCOLS 8
62 +#define PAGE_MODE_ROWSCOLS 8 /* for -S option */
63
64 #define INVERT_DATA_ONLY 10
65 #define INVERT_DATA_AND_TAG 11
66 @@ -781,7 +781,7 @@ static const char usage_info[] =
67 " The four debug/dump options are independent, though it makes little sense to\n"
68 " specify a dump file without specifying a detail level.\n"
69 "\n"
70 -"Note: The (-X|-Y), -Z and -z options are mutually exclusive.\n"
71 +"Note: The (-X|-Y), -Z, -z and -S options are mutually exclusive.\n"
72 " In no case should the options be applied to a given selection successively.\n"
73 "\n"
74 ;
75 @@ -2131,13 +2131,14 @@ void process_command_opts (int argc, ch
76 /*NOTREACHED*/
77 }
78 }
79 - /*-- Check for not allowed combinations (e.g. -X, -Y and -Z and -z are mutually exclusive) --*/
80 - char XY, Z, R;
81 + /*-- Check for not allowed combinations (e.g. -X, -Y and -Z, -z and -S are mutually exclusive) --*/
82 + char XY, Z, R, S;
83 XY = ((crop_data->crop_mode & CROP_WIDTH) || (crop_data->crop_mode & CROP_LENGTH));
84 Z = (crop_data->crop_mode & CROP_ZONES);
85 R = (crop_data->crop_mode & CROP_REGIONS);
86 - if ((XY && Z) || (XY && R) || (Z && R)) {
87 - TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z and -z are mutually exclusive.->Exit");
88 + S = (page->mode & PAGE_MODE_ROWSCOLS);
89 + if ((XY && Z) || (XY && R) || (XY && S) || (Z && R) || (Z && S) || (R && S)) {
90 + TIFFError("tiffcrop input error", "The crop options(-X|-Y), -Z, -z and -S are mutually exclusive.->Exit");
91 exit(EXIT_FAILURE);
92 }
93 } /* end process_command_opts */