diff options
author | Werner Koch <[email protected]> | 2024-05-21 12:36:07 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2024-05-21 12:36:07 +0000 |
commit | ac4bf86bb65a1e228550cce9314ad17239343c5d (patch) | |
tree | daf244bfe0c36f3712bc730707559f71da104597 | |
parent | tests: Avoid some compiler warnings. (diff) | |
download | gpgme-ac4bf86bb65a1e228550cce9314ad17239343c5d.tar.gz gpgme-ac4bf86bb65a1e228550cce9314ad17239343c5d.zip |
tests: Fix segv in t-json.c
* tests/json/t-json.c (test_contains): Avoid calling recusivly with no
child.
-rw-r--r-- | tests/json/t-json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/json/t-json.c b/tests/json/t-json.c index 0d127a49..4fe74ed7 100644 --- a/tests/json/t-json.c +++ b/tests/json/t-json.c @@ -260,7 +260,7 @@ test_contains (cjson_t needle, cjson_t hay) fprintf (stderr, "Depth mismatch. Expected child for %s\n", nonnull (needle->string)); } - if (test_contains (needle->child, hay->child)) + else if (test_contains (needle->child, hay->child)) { int found = 0; cjson_t hit; |