mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-28 06:15:21 +00:00
Avoid SIGSEV due to non-existant string section.
This commit is contained in:
parent
812f7299b3
commit
88503347da
@ -44,12 +44,14 @@ class string_section_accessor
|
|||||||
const char*
|
const char*
|
||||||
get_string( Elf_Word index ) const
|
get_string( Elf_Word index ) const
|
||||||
{
|
{
|
||||||
if ( index < string_section->get_size() ) {
|
if ( string_section ) {
|
||||||
const char* data = string_section->get_data();
|
if ( index < string_section->get_size() ) {
|
||||||
if ( 0 != data ) {
|
const char* data = string_section->get_data();
|
||||||
return data + index;
|
if ( 0 != data ) {
|
||||||
|
return data + index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user