Skip to content
Snippets Groups Projects
Commit f1c7d420 authored by Alan Jowett's avatar Alan Jowett Committed by Serge Lamikhov-Center
Browse files

Validate that strings in table are null terminated

parent 2879ee62
Branches
No related tags found
No related merge requests found
......@@ -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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment