diff options
Diffstat (limited to 'meta/recipes-graphics/freetype/freetype/CVE-2022-27404.patch')
-rw-r--r-- | meta/recipes-graphics/freetype/freetype/CVE-2022-27404.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-graphics/freetype/freetype/CVE-2022-27404.patch b/meta/recipes-graphics/freetype/freetype/CVE-2022-27404.patch new file mode 100644 index 0000000000..e66400ddb1 --- /dev/null +++ b/meta/recipes-graphics/freetype/freetype/CVE-2022-27404.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 53dfdcd8198d2b3201a23c4bad9190519ba918db Mon Sep 17 00:00:00 2001 | ||
2 | From: Werner Lemberg <wl@gnu.org> | ||
3 | Date: Thu, 17 Mar 2022 19:24:16 +0100 | ||
4 | Subject: [PATCH] [sfnt] Avoid invalid face index. | ||
5 | |||
6 | Fixes #1138. | ||
7 | |||
8 | * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font): | ||
9 | Check `face_index` before decrementing. | ||
10 | |||
11 | CVE: CVE-2022-27404 | ||
12 | Upstream-Status: Backport [https://gitlab.freedesktop.org/freetype/freetype/-/commit/53dfdcd8198d2b3201a23c4bad9190519ba918db.patch] | ||
13 | Comment: Removed second hunk as sfwoff2.c file is not part of current v2.10.1 code | ||
14 | Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@kpit.com> | ||
15 | --- | ||
16 | src/sfnt/sfobjs.c | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c | ||
20 | index f9d4d3858..9771c35df 100644 | ||
21 | --- a/src/sfnt/sfobjs.c | ||
22 | +++ b/src/sfnt/sfobjs.c | ||
23 | @@ -566,7 +566,7 @@ | ||
24 | face_index = FT_ABS( face_instance_index ) & 0xFFFF; | ||
25 | |||
26 | /* value -(N+1) requests information on index N */ | ||
27 | - if ( face_instance_index < 0 ) | ||
28 | + if ( face_instance_index < 0 && face_index > 0 ) | ||
29 | face_index--; | ||
30 | |||
31 | if ( face_index >= face->ttc_header.count ) | ||
32 | -- | ||
33 | GitLab | ||