mirror of
https://git.yoctoproject.org/poky
synced 2026-04-30 21:32:13 +02:00
Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=19c26da69d68d5d863f37c06ad73ab6292d02ffa] Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=ec41dd75c866599fc03c390c6afb5736c159c0ff] Upstream-Status: Backport [https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f18acc9c4e5d18f4783f3a7d59e3ec95d7af0199] Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e98e7d9a70dcc987bff0e925f20b78cd4a2979ed] (From OE-Core rev: e384b754eb0223928c239db42ece93c06dce6daa) Signed-off-by: pgowda <pgowda.cve@gmail.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
44 lines
1.6 KiB
Diff
44 lines
1.6 KiB
Diff
From e98e7d9a70dcc987bff0e925f20b78cd4a2979ed Mon Sep 17 00:00:00 2001
|
|
From: Nick Clifton <nickc@redhat.com>
|
|
Date: Mon, 27 Jun 2022 13:30:35 +0100
|
|
Subject: [PATCH] Fix NULL pointer indirection when parsing corrupt DWARF data.
|
|
|
|
PR 29290
|
|
* dwarf.c (read_and_display_attr_value): Check that debug_info_p
|
|
is set before dereferencing it.
|
|
|
|
Upstream-Status: Backport [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e98e7d9a70dcc987bff0e925f20b78cd4a2979ed]
|
|
|
|
Signed-off-by: Pgowda <pgowda.cve@gmail.com>
|
|
---
|
|
binutils/dwarf.c | 11 +++++------
|
|
|
|
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
|
|
index bcabb61b871..37b477b886d 100644
|
|
--- a/binutils/dwarf.c
|
|
+++ b/binutils/dwarf.c
|
|
@@ -2727,18 +2727,17 @@ read_and_display_attr_value (unsigned lo
|
|
{
|
|
const char *suffix = strrchr (section->name, '.');
|
|
bool dwo = suffix && strcmp (suffix, ".dwo") == 0;
|
|
+ const char *strng;
|
|
|
|
+ strng = fetch_indexed_string (uvalue, this_set, offset_size, dwo,
|
|
+ debug_info_p ? debug_info_p->str_offsets_base : 0);
|
|
if (do_wide)
|
|
/* We have already displayed the form name. */
|
|
printf (_("%c(offset: 0x%s): %s"), delimiter,
|
|
- dwarf_vmatoa ("x", uvalue),
|
|
- fetch_indexed_string (uvalue, this_set, offset_size, dwo,
|
|
- debug_info_p->str_offsets_base));
|
|
+ dwarf_vmatoa ("x", uvalue), strng);
|
|
else
|
|
printf (_("%c(indexed string: 0x%s): %s"), delimiter,
|
|
- dwarf_vmatoa ("x", uvalue),
|
|
- fetch_indexed_string (uvalue, this_set, offset_size, dwo,
|
|
- debug_info_p->str_offsets_base));
|
|
+ dwarf_vmatoa ("x", uvalue), strng);
|
|
}
|
|
break;
|
|
|