!206 [sync] PR-201: fix CVE-2022-47011

From: @openeuler-sync-bot 
Reviewed-by: @eastb233 
Signed-off-by: @eastb233
This commit is contained in:
openeuler-ci-bot 2023-08-26 06:48:17 +00:00 committed by Gitee
commit c3bbe20511
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From d88510a426e0c310ecfe9955837fdbc9fdc6aa51 Mon Sep 17 00:00:00 2001
From: liningjie <liningjie@xfusion.com>
Date: Tue, 15 Aug 2023 02:56:30 +0800
Subject: [PATCH] PR29261, memory leak in parse_stab_struct_fields
PR 29261
* stabs.c (parse_stab_struct_fields): Free "fields" on failure path.
---
binutils/stabs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/binutils/stabs.c b/binutils/stabs.c
index 395ed52d..207dc52f 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -2368,7 +2368,10 @@ parse_stab_struct_fields (void * dhandle,
if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c,
staticsp, p_end))
- return FALSE;
+ {
+ free (fields);
+ return FALSE;
+ }
++c;
}
--
2.33.0

View File

@ -1,7 +1,7 @@
Summary: Binary utilities
Name: binutils
Version: 2.34
Release: 23
Release: 24
License: GPLv3+
URL: https://sourceware.org/binutils
@ -60,6 +60,7 @@ Patch43: backport-0002-CVE-2021-42574.patch
Patch44: Fix-gold-relocation-offset.patch
Patch45: Fix-gold-adrp-signed-shift.patch
Patch46: CVE-2022-47008.patch
Patch47: backport-CVE-2022-47011.patch
Provides: bundled(libiberty)
@ -338,6 +339,9 @@ fi
%{_infodir}/bfd*info*
%changelog
* Thu Aug 24 2023 liningjie <liningjie@xfusion.com> - 2.34-24
- fix CVE-2022-47011
* Wed Aug 23 2023 liningjie <liningjie@xfusion.com> - 2.34-23
- fix CVE-2022-47008