fix_lex_number.patch
text/x-patch
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/common/jsonapi.c | 5 | 0 |
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c
index 5f947dd618..b003656ff8 100644
--- a/src/common/jsonapi.c
+++ b/src/common/jsonapi.c
@@ -297,6 +297,8 @@ IsValidJsonNumber(const char *str, int len)
dummy_lex.input_length = len;
}
+ dummy_lex.token_start = dummy_lex.input;
+
json_lex_number(&dummy_lex, dummy_lex.input, &numeric_error, &total_len);
return (!numeric_error) && (total_len == dummy_lex.input_length);
@@ -2018,6 +2020,9 @@ json_lex_number(JsonLexContext *lex, char *s,
{
appendBinaryStringInfo(&lex->inc_state->partial_token,
lex->token_start, s - lex->token_start);
+ if (num_err != NULL)
+ *num_err = false;
+
return JSON_INCOMPLETE;
}
else if (num_err != NULL)