We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce36831 commit 629f085Copy full SHA for 629f085
1 file changed
src/Store/Store.cpp
@@ -124,6 +124,12 @@ namespace ToolFramework {
124
}
125
126
bool Store::JsonParser(const char* input) {
127
+ const char* s = json_scan(input);
128
+ s = json_scan_whitespace(s);
129
+ if (!s || *s) return false; // invalid JSON string
130
+
131
+ // We have validated input, so in the following `return false` should never
132
+ // happen. We keep it, however, just in case.
133
bool result = json_decode_object(
134
input,
135
[this](const char*& input_, std::string key) -> bool {
@@ -165,8 +171,6 @@ namespace ToolFramework {
165
171
);
166
172
if (!result) return false;
167
173
168
- input = json_scan_whitespace(input);
169
- if (!input || *input) return false; // junk at the end
170
174
return true;
175
};
176
0 commit comments