summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch')
-rw-r--r--meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch b/meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch
new file mode 100644
index 0000000000..67837fe142
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/CVE-2023-3576.patch
@@ -0,0 +1,35 @@
1From 881a070194783561fd209b7c789a4e75566f7f37 Mon Sep 17 00:00:00 2001
2From: zhailiangliang <zhailiangliang@loongson.cn>
3Date: Tue, 7 Mar 2023 15:02:08 +0800
4Subject: [PATCH] Fix memory leak in tiffcrop.c
5
6Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/commit/881a070194783561fd209b7c789a4e75566f7f37]
7CVE: CVE-2023-3576
8Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
9Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
10---
11 tools/tiffcrop.c | 7 ++++++-
12 1 file changed, 6 insertions(+), 1 deletion(-)
13
14diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
15index f14bb0c..7121c7c 100644
16--- a/tools/tiffcrop.c
17+++ b/tools/tiffcrop.c
18@@ -7746,8 +7746,13 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
19
20 read_buff = *read_buff_ptr;
21
22+ /* Memory is freed before crop_buff_ptr is overwritten */
23+ if (*crop_buff_ptr != NULL)
24+ {
25+ _TIFFfree(*crop_buff_ptr);
26+ }
27+
28 /* process full image, no crop buffer needed */
29- crop_buff = read_buff;
30 *crop_buff_ptr = read_buff;
31 crop->combined_width = image->width;
32 crop->combined_length = image->length;
33--
342.25.1
35