Fix potential use of uninitialized variables

This commit is contained in:
Richard Chien 2022-05-17 14:37:28 +00:00 committed by Serge Lamikhov-Center
parent 292367751d
commit 1cb8be7aee
2 changed files with 4 additions and 4 deletions

View File

@ -45,8 +45,8 @@ template <class S> class dynamic_section_accessor_template
entries_num = entries_num =
dynamic_section->get_size() / dynamic_section->get_entry_size(); dynamic_section->get_size() / dynamic_section->get_entry_size();
Elf_Xword i; Elf_Xword i;
Elf_Xword tag; Elf_Xword tag = DT_NULL;
Elf_Xword value; Elf_Xword value = 0;
std::string str; std::string str;
for ( i = 0; i < entries_num; i++ ) { for ( i = 0; i < entries_num; i++ ) {
get_entry( i, tag, value, str ); get_entry( i, tag, value, str );

View File

@ -127,8 +127,8 @@ template <class S> class relocation_section_accessor_template
Elf_Sxword& calcValue ) const Elf_Sxword& calcValue ) const
{ {
// Do regular job // Do regular job
Elf_Word symbol; Elf_Word symbol = 0;
bool ret = get_entry( index, offset, symbol, type, addend ); bool ret = get_entry( index, offset, symbol, type, addend );
// Find the symbol // Find the symbol
Elf_Xword size; Elf_Xword size;