Commit bb21b344 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed semantic analysis or empty JSON integer default values



Change-Id: Id39b94b213977a99f149f6237f1e8871601c324b
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 7f822b91
......@@ -3112,14 +3112,22 @@ namespace Common {
err = true;
}
break;
case T_INT:
case T_INT: {
boolean first_digit = false; // there's at least one digit
for (size_t i = (dval[0] == '-') ? 1 : 0; i < dval_len; ++i) {
if (dval[i] < '0' || dval[i] > '9') {
err = true;
break; // from the loop
}
else {
first_digit = true;
}
}
break;
if (!first_digit) {
// empty value or just a '-'
err = true;
}
break; }
case T_REAL: {
if (strcmp(dval, "infinity") == 0 || strcmp(dval, "-infinity") == 0 ||
strcmp(dval, "not_a_number") == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment