commit | 94927ebb840755b6ff3b42f35a12a14c8b724acc | [log] [tgz] |
---|---|---|
author | aPiecek <piecek@cesnet.cz> | Wed May 05 12:36:50 2021 +0200 |
committer | Michal Vasko <mvasko@cesnet.cz> | Thu May 06 07:15:32 2021 +0200 |
tree | e1ec1771d7459f770b6d07039ccba0afca58aaac | |
parent | 58e46a5d124c1e050d21380cf41061ea2ff7a82f [diff] [blame] |
json BUGFIX limit for number encoded as a string
diff --git a/src/json.c b/src/json.c index eee0e4f..440725a 100644 --- a/src/json.c +++ b/src/json.c
@@ -425,6 +425,9 @@ } } + LY_CHECK_ERR_RET((num_len + 1) > LY_NUMBER_MAXLEN, LOGVAL(jsonctx->ctx, LYVE_SEMANTICS, + "Number encoded as a string exceeded the LY_NUMBER_MAXLEN limit."), LY_EVALID); + /* allocate buffer for the result (add terminating NULL-byte */ num = malloc(num_len + 1); LY_CHECK_ERR_RET(!num, LOGMEM(jsonctx->ctx), LY_EMEM);