diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2022-47011.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2022-47011.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2022-47011.patch b/meta/recipes-devtools/binutils/binutils/CVE-2022-47011.patch new file mode 100644 index 0000000000..250756bd38 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2022-47011.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 8a24927bc8dbf6beac2000593b21235c3796dc35 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Modra <amodra@gmail.com> | ||
3 | Date: Mon, 20 Jun 2022 10:39:13 +0930 | ||
4 | Subject: [PATCH] PR29261, memory leak in parse_stab_struct_fields | ||
5 | |||
6 | PR 29261 | ||
7 | * stabs.c (parse_stab_struct_fields): Free "fields" on failure path. | ||
8 | Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff_plain;h=8a24927bc8dbf6beac2000593b21235c3796dc35] | ||
9 | CVE: CVE-2022-47011 | ||
10 | Signed-off-by: Virendra Thakur <virendrak@kpit.com> | ||
11 | Comment: Patch refreshed based on codebase. | ||
12 | --- | ||
13 | binutils/stabs.c | 5 ++++- | ||
14 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/binutils/stabs.c b/binutils/stabs.c | ||
17 | index 796ff85b86a..bf3f578cbcc 100644 | ||
18 | --- a/binutils/stabs.c | ||
19 | +++ b/binutils/stabs.c | ||
20 | @@ -2368,7 +2368,10 @@ | ||
21 | |||
22 | if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c, | ||
23 | staticsp, p_end)) | ||
24 | - return FALSE; | ||
25 | + { | ||
26 | + free (fields); | ||
27 | + return FALSE; | ||
28 | + } | ||
29 | |||
30 | ++c; | ||
31 | } | ||