mirror of
https://github.com/serge1/ELFIO.git
synced 2025-04-17 08:44:25 +00:00
Fix NULL deference for no ELF files
Fix crash 060833f08dc14d1712428742b3cad7af17b36bb7
This commit is contained in:
parent
bd5f2128ae
commit
abab994411
@ -148,12 +148,11 @@ class elfio
|
||||
{
|
||||
std::ofstream f( file_name.c_str(), std::ios::out | std::ios::binary );
|
||||
|
||||
if ( !f ) {
|
||||
if ( !f || !header) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_still_good = true;
|
||||
|
||||
// Define layout specific header fields
|
||||
// The position of the segment table is fixed after the header.
|
||||
// The position of the section table is variable and needs to be fixed
|
||||
|
Loading…
x
Reference in New Issue
Block a user