diff --git a/elfio/elfio_section.hpp b/elfio/elfio_section.hpp index 2532902..6eed58b 100644 --- a/elfio/elfio_section.hpp +++ b/elfio/elfio_section.hpp @@ -26,6 +26,7 @@ THE SOFTWARE. #include #include #include +#include namespace ELFIO { @@ -198,10 +199,10 @@ template class section_impl : public section set_stream_size( stream.tellg() ); } else { - set_stream_size( 0xFFFFFFFFFFFFFFFF ); + set_stream_size( ULLONG_MAX ); } - stream.seekg( ( *translator )[ header_offset ] ); + stream.seekg( ( *translator )[header_offset] ); stream.read( reinterpret_cast( &header ), sizeof( header ) ); Elf_Xword size = get_size(); @@ -211,7 +212,7 @@ template class section_impl : public section if ( ( 0 != size ) && ( nullptr != data ) ) { stream.seekg( - ( *translator )[ ( *convertor )( header.sh_offset ) ] ); + ( *translator )[( *convertor )( header.sh_offset )] ); stream.read( data, size ); data[size] = 0; // Ensure data is ended with 0 to avoid oob read data_size = size; diff --git a/elfio/elfio_segment.hpp b/elfio/elfio_segment.hpp index e2cf251..aff4030 100644 --- a/elfio/elfio_segment.hpp +++ b/elfio/elfio_segment.hpp @@ -26,6 +26,7 @@ THE SOFTWARE. #include #include #include +#include namespace ELFIO { @@ -173,7 +174,7 @@ template class segment_impl : public segment set_stream_size( stream.tellg() ); } else { - set_stream_size( 0xFFFFFFFFFFFFFFFF ); + set_stream_size( ULLONG_MAX ); } stream.seekg( ( *translator )[header_offset] );