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 =
dynamic_section->get_size() / dynamic_section->get_entry_size();
Elf_Xword i;
Elf_Xword tag;
Elf_Xword value;
Elf_Xword tag = DT_NULL;
Elf_Xword value = 0;
std::string str;
for ( i = 0; i < entries_num; i++ ) {
get_entry( i, tag, value, str );

View File

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