summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch')
-rw-r--r--meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch b/meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch
new file mode 100644
index 0000000000..08fccd5a3b
--- /dev/null
+++ b/meta/recipes-graphics/freetype/freetype/CVE-2022-27405.patch
@@ -0,0 +1,38 @@
1From 22a0cccb4d9d002f33c1ba7a4b36812c7d4f46b5 Mon Sep 17 00:00:00 2001
2From: Werner Lemberg <wl@gnu.org>
3Date: Sat, 19 Mar 2022 06:40:17 +0100
4Subject: [PATCH] * src/base/ftobjs.c (ft_open_face_internal): Properly guard
5 `face_index`.
6We must ensure that the cast to `FT_Int` doesn't change the sign.
7Fixes #1139.
8
9CVE: CVE-2022-27405
10Upstream-Status: Backport [https://gitlab.freedesktop.org/freetype/freetype/-/commit/22a0cccb4d9d002f33c1ba7a4b36812c7d4f46b5]
11Comment: No Change in any hunk
12Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com>
13---
14 src/base/ftobjs.c | 9 +++++++++
15 1 file changed, 9 insertions(+)
16
17diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
18index 2c0f0e6c9..10952a6c6 100644
19--- a/src/base/ftobjs.c
20+++ b/src/base/ftobjs.c
21@@ -2527,6 +2527,15 @@
22 #endif
23
24
25+ /* only use lower 31 bits together with sign bit */
26+ if ( face_index > 0 )
27+ face_index &= 0x7FFFFFFFL;
28+ else
29+ {
30+ face_index &= 0x7FFFFFFFL;
31+ face_index = -face_index;
32+ }
33+
34 #ifdef FT_DEBUG_LEVEL_TRACE
35 FT_TRACE3(( "FT_Open_Face: " ));
36 if ( face_index < 0 )
37--
38GitLab