json MAINTENANCE added LY_NUMBER_MAXLEN check
For a number with an exponent, the check is applied, so for consistency
it should also be applied to numbers without an exponent.
diff --git a/src/json.c b/src/json.c
index 3e36b0f..c5c3f32 100644
--- a/src/json.c
+++ b/src/json.c
@@ -701,7 +701,11 @@
LY_CHECK_RET(lyjson_exp_number(jsonctx->ctx, in, exponent, offset, &num, &num_len));
lyjson_ctx_set_value(jsonctx, num, num_len, 1);
} else {
- /* store the number */
+ if (offset > LY_NUMBER_MAXLEN) {
+ LOGVAL(jsonctx->ctx, LYVE_SEMANTICS,
+ "Number encoded as a string exceeded the LY_NUMBER_MAXLEN limit.");
+ return LY_EVALID;
+ }
lyjson_ctx_set_value(jsonctx, in, offset, 0);
}
ly_in_skip(jsonctx->in, offset);