kernelshark: Fix TEP filter array parsing logic
When saving a session with more than a single TEP advanced filter,
KernelShark triggers a json-c assertion:
"json_object_array_get_idx: Assertion
`json_object_get_type(jso) == json_type_array' failed."
This is caused because the code reuses the `jfilter` variable inside
the loop to fetch each array element:
jfilter = json_object_array_get_idx(jfilter, i);
This overwrites the original array object. On the next iteration,
`jfilter` is no longer a json_type_array, causing the assertion.
Fix this by introducing a temporary variable `jitem` to store each
array element, leaving `jfilter` to point to the actual array.
Signed-off-by: Ciunas Bennett <ciunas@linux.ibm.com>
Signed-off-by: Yordan Karadzhov <y.karadz@gmail.com>
1 file changed