mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-25 15:13:45 +00:00
Fix possible nullptr dereference
This commit is contained in:
parent
2a029fe589
commit
e656f75767
@ -138,8 +138,12 @@ class elfio
|
||||
bool load( const std::string& file_name, bool is_lazy = false )
|
||||
{
|
||||
pstream = std::make_unique<std::ifstream>();
|
||||
if ( !pstream ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
pstream->open( file_name.c_str(), std::ios::in | std::ios::binary );
|
||||
if ( pstream == nullptr || !*pstream ) {
|
||||
if ( !*pstream ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user