mirror of
https://github.com/serge1/ELFIO.git
synced 2024-12-26 18:15:40 +00:00
Validate that strings in table are null terminated
Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
parent
2879ee62a2
commit
f1c7d420e4
@ -46,7 +46,11 @@ template <class S> class string_section_accessor_template
|
||||
if ( index < string_section->get_size() ) {
|
||||
const char* data = string_section->get_data();
|
||||
if ( nullptr != data ) {
|
||||
return data + index;
|
||||
size_t string_length = strnlen(
|
||||
data + index, string_section->get_size() - index );
|
||||
if ( string_length <
|
||||
( string_section->get_size() - index ) )
|
||||
return data + index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user