Throw if property length is out of bounds

pull/3542/head
Max Vollmer 2020-12-14 16:49:04 +00:00
parent 0e939cc450
commit 9d3c0081eb
1 changed files with 5 additions and 0 deletions

View File

@ -375,6 +375,11 @@ bool ReadScope(TokenList& output_tokens, const char* input, const char*& cursor,
// now come the individual properties
const char* begin_cursor = cursor;
if ((begin_cursor + prop_length) > end) {
TokenizeError("property length out of bounds reading length ", input, cursor);
}
for (unsigned int i = 0; i < prop_count; ++i) {
ReadData(sbeg, send, input, cursor, begin_cursor + prop_length);