Avoid SIGSEV due to non-existant string section.

This commit is contained in:
Tim Strazzere 2016-04-20 15:05:23 -07:00 committed by Serge Lamikhov-Center
parent 812f7299b3
commit 88503347da

View File

@ -44,12 +44,14 @@ class string_section_accessor
const char*
get_string( Elf_Word index ) const
{
if ( index < string_section->get_size() ) {
const char* data = string_section->get_data();
if ( 0 != data ) {
return data + index;
if ( string_section ) {
if ( index < string_section->get_size() ) {
const char* data = string_section->get_data();
if ( 0 != data ) {
return data + index;
}
}
}
}
return 0;
}