diff options
Diffstat (limited to 'meta/recipes-multimedia/libtiff/files/CVE-2023-40745.patch')
-rw-r--r-- | meta/recipes-multimedia/libtiff/files/CVE-2023-40745.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2023-40745.patch b/meta/recipes-multimedia/libtiff/files/CVE-2023-40745.patch new file mode 100644 index 0000000000..6eb286039f --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2023-40745.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 4fc16f649fa2875d5c388cf2edc295510a247ee5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arie Haenel <arie.haenel@jct.ac.il> | ||
3 | Date: Wed, 19 Jul 2023 19:34:25 +0000 | ||
4 | Subject: [PATCH] tiffcp: fix memory corruption (overflow) on hostile images | ||
5 | (fixes #591) | ||
6 | |||
7 | Upstream-Status: Backport from [https://gitlab.com/libtiff/libtiff/-/commit/4fc16f649fa2875d5c388cf2edc295510a247ee5] | ||
8 | CVE: CVE-2023-40745 | ||
9 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
10 | --- | ||
11 | tools/tiffcp.c | 7 +++++++ | ||
12 | 1 file changed, 7 insertions(+) | ||
13 | |||
14 | diff --git a/tools/tiffcp.c b/tools/tiffcp.c | ||
15 | index 83b3910..007bd05 100644 | ||
16 | --- a/tools/tiffcp.c | ||
17 | +++ b/tools/tiffcp.c | ||
18 | @@ -1437,6 +1437,13 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer) | ||
19 | TIFFError(TIFFFileName(in), "Error, cannot handle that much samples per tile row (Tile Width * Samples/Pixel)"); | ||
20 | return 0; | ||
21 | } | ||
22 | + | ||
23 | + if ( (imagew - tilew * spp) > INT_MAX ){ | ||
24 | + TIFFError(TIFFFileName(in), | ||
25 | + "Error, image raster scan line size is too large"); | ||
26 | + return 0; | ||
27 | + } | ||
28 | + | ||
29 | iskew = imagew - tilew*spp; | ||
30 | tilebuf = _TIFFmalloc(tilesize); | ||
31 | if (tilebuf == 0) | ||
32 | -- | ||
33 | 2.25.1 | ||
34 | |||