mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-03 12:21:23 +00:00
fixed off-by-one in parser
This commit is contained in:
@@ -492,7 +492,7 @@ CheckedError Parser::Next() {
|
||||
if (has_sign) {
|
||||
// Check for +/-inf which is considered a float constant.
|
||||
if (strncmp(cursor_, "inf", 3) == 0 &&
|
||||
!(IsIdentifierStart(cursor_[4]) || is_digit(cursor_[4]))) {
|
||||
!(IsIdentifierStart(cursor_[3]) || is_digit(cursor_[3]))) {
|
||||
attribute_.assign(cursor_ - 1, cursor_ + 3);
|
||||
token_ = kTokenFloatConstant;
|
||||
cursor_ += 3;
|
||||
|
||||
Reference in New Issue
Block a user