Add check for data endianess flags

This commit is contained in:
Serge Lamikhov-Center 2021-06-05 16:46:24 +03:00
parent 0fac6ce45b
commit 79fcd11595

View File

@ -129,6 +129,11 @@ class elfio
return false; return false;
} }
if ( ( e_ident[EI_DATA] != ELFDATA2LSB ) &&
( e_ident[EI_DATA] != ELFDATA2MSB ) ) {
return false;
}
convertor.setup( e_ident[EI_DATA] ); convertor.setup( e_ident[EI_DATA] );
header = create_header( e_ident[EI_CLASS], e_ident[EI_DATA] ); header = create_header( e_ident[EI_CLASS], e_ident[EI_DATA] );
if ( 0 == header ) { if ( 0 == header ) {