An OOM vulnerability exists in the json_pointer_set function (and related functions).
See issue #916 for more details.
To fix that, added a sanity check in the is_valid_index function to limit the maximum value of a parsed array index.
Provided a configurable macro for modification.
Signed-off-by: lone <lonechan314@qq.com>
These were wrong. Some details about the json_pointer_setf() &
json_pointer_getf() were added in the json_pointer_set() &
json_pointer_get() doc-strings.
This change removes them.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
These include support for printf() style args for path.
Adds support for calling with 'json_pointer_getf(obj, &res, "/foo/%d/%s", 0, bar)'
style args.
Makes it easier for doing more dynamic stuff/magic, without
needing to use vasprintf() externally.
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>