b33e0caf90
The spdk_json_decode_array() function previously tried to check whether the array would fit into the provided number of output elements (max_size) before decoding; however, the check was incorrectly comparing the total number of nested JSON values in the array rather than just the count of top-level array elements. Rather than doing the check up front (which can't be done without modifying the way array lengths are stored in spdk_json_value), just check if we have reached the end of the 'out' array on each iteration of the decoding loop. Fixes GitHub issue #232. Change-Id: I4d7ce4be022bdf5f726654d0d96277b9d63bd350 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/397591 Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: <shuhei.matsumoto.xt@hitachi.com> |
||
---|---|---|
.. | ||
json_parse.c | ||
json_util.c | ||
json_write.c | ||
Makefile |