mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-28 06:15:21 +00:00
elfio_note: fix MSVC compiler warning
Fix the following MSVC compiler warning: elfio/elfio_note.hpp(77): warning C4267: 'initializing' : conversion from 'size_t' to 'ELFIO::Elf_Word', possible loss of data by changing the type of max_name_sizei to Elf_Xword, as note_secton->get_size() returns Elf_Xword and note_start_positions also contains members of type Elf_Xword.
This commit is contained in:
parent
af4140a122
commit
446e0c215c
@ -74,7 +74,7 @@ class note_section_accessor
|
|||||||
type = convertor( *(const Elf_Word*)( pData + 2*align ) );
|
type = convertor( *(const Elf_Word*)( pData + 2*align ) );
|
||||||
Elf_Word namesz = convertor( *(const Elf_Word*)( pData ) );
|
Elf_Word namesz = convertor( *(const Elf_Word*)( pData ) );
|
||||||
descSize = convertor( *(const Elf_Word*)( pData + sizeof( namesz ) ) );
|
descSize = convertor( *(const Elf_Word*)( pData + sizeof( namesz ) ) );
|
||||||
Elf_Word max_name_size = note_section->get_size() - note_start_positions[index];
|
Elf_Xword max_name_size = note_section->get_size() - note_start_positions[index];
|
||||||
if ( namesz > max_name_size ||
|
if ( namesz > max_name_size ||
|
||||||
namesz + descSize > max_name_size ) {
|
namesz + descSize > max_name_size ) {
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user