From fb58f5e9286a7ea5c6f0977595c37f11087f5883 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 24 Jun 2020 17:38:16 +0100 Subject: [PATCH] Fix a potential use of an uninitialised variable error in gold. * target-reloc.h (issue_discarded_error): Initialise the key_symndx variable. --- gold/ChangeLog | 5 +++++ gold/target-reloc.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 4d524d7f5ac..78b5579cd87 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2020-06-24 Nick Clifton + + * target-reloc.h (issue_discarded_error): Initialise the + key_symndx variable. + 2020-06-23 Roland McGrath PR 22843 diff --git a/gold/target-reloc.h b/gold/target-reloc.h index 2b205a1a74b..e9e3e5b0027 100644 --- a/gold/target-reloc.h +++ b/gold/target-reloc.h @@ -258,7 +258,7 @@ issue_discarded_error( &is_ordinary); if (orig_shndx != elfcpp::SHN_UNDEF) { - unsigned int key_symndx; + unsigned int key_symndx = 0; Relobj* kept_obj = object->find_kept_section_object(orig_shndx, &key_symndx); if (key_symndx != 0) -- 2.30.2