mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-26 18:15:40 +00:00
Stop parsing ELF if segment header is beyond end of file
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
parent
1cb8be7aee
commit
3e6809cf13
@ -550,6 +550,11 @@ class elfio
|
||||
seg->load( stream,
|
||||
static_cast<std::streamoff>( offset ) +
|
||||
static_cast<std::streampos>( i ) * entry_size );
|
||||
|
||||
if ( stream.fail() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
seg->set_index( i );
|
||||
|
||||
// Add sections to the segments (similar to readelfs algorithm)
|
||||
|
Loading…
Reference in New Issue
Block a user