binutils/backport-CVE-2022-38126.patch
2022-09-08 17:19:35 +08:00

35 lines
1.2 KiB
Diff

From 753efb93dc018558c483111fbfe14c4ee8c84c51 Mon Sep 17 00:00:00 2001
From: yinyongkang <yinyongkang@kylinos.cn>
Date: Thu, 8 Sep 2022 17:14:11 +0800
Subject: [PATCH] Replace a run-time assertion failure with a warning message
when parsing corrupt...
PR 29289
* dwarf.c (display_debug_names): Replace assert with a warning
message.
---
binutils/dwarf.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 1e7f4db7..7c54820a 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -9781,7 +9781,12 @@ display_debug_names (struct dwarf_section *section, void *file)
printf (_("Out of %lu items there are %zu bucket clashes"
" (longest of %zu entries).\n"),
(unsigned long) name_count, hash_clash_count, longest_clash);
- assert (name_count == buckets_filled + hash_clash_count);
+
+ if (name_count != buckets_filled + hash_clash_count)
+ warn (_("The name_count (%lu) is not the same as the used bucket_count (%lu) + the hash clash count (%lu)"),
+ (unsigned long) name_count,
+ (unsigned long) buckets_filled,
+ (unsigned long) hash_clash_count);
struct abbrev_lookup_entry
{
--
2.33.0