mirror of
https://github.com/json-c/json-c.git
synced 2026-03-30 02:19:06 +08:00
Fix an uninitialized memory access in json_pointer.
Add comments describing when the fields of the internal struct json_pointer_get_result are valid.
This commit is contained in:
@@ -19,10 +19,11 @@ extern "C" {
|
||||
struct json_pointer_get_result {
|
||||
struct json_object *parent;
|
||||
struct json_object *obj;
|
||||
union {
|
||||
const char *key;
|
||||
uint32_t index;
|
||||
} id;
|
||||
// The key of the found object; only valid when parent is json_type_object
|
||||
// Caution: re-uses tail end of the `path` argument to json_pointer_get_internal
|
||||
const char *key_in_parent;
|
||||
// the index of the found object; only valid when parent is json_type_array
|
||||
uint32_t index_in_parent;
|
||||
};
|
||||
|
||||
int json_pointer_get_internal(struct json_object *obj, const char *path,
|
||||
|
||||
Reference in New Issue
Block a user