From 1c643a08b02aff5a5231eda9af8ffbaf91d5eaca Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 18 Mar 2021 17:55:30 +0100 Subject: [PATCH] added a test whether we have reach the end of the input string without this such an input json (incorrect json string as there is no {} characters): "key": "value" would be parsed correctly: "key" would be parsed and the rest would be skipped --- space/spaceparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/space/spaceparser.cpp b/space/spaceparser.cpp index 09bd6b6..6ec23e7 100644 --- a/space/spaceparser.cpp +++ b/space/spaceparser.cpp @@ -323,6 +323,11 @@ void SpaceParser::ParseRootSpace() Parse(root_space, false, false); } + SkipWhite(); + + if( lastc != -1 ) + status = syntax_error; + token.clear(); }