From 3091811d184ead357e596fb137d66423d11b99e0 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Fri, 18 Oct 2024 16:31:00 +0800 Subject: [PATCH] Fix segv in t-json.c --- backport-tests-Fix-segv-in-t-json.c.patch | 26 +++++++++++++++++++++++ gpgme.spec | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 backport-tests-Fix-segv-in-t-json.c.patch diff --git a/backport-tests-Fix-segv-in-t-json.c.patch b/backport-tests-Fix-segv-in-t-json.c.patch new file mode 100644 index 0000000..3f0c254 --- /dev/null +++ b/backport-tests-Fix-segv-in-t-json.c.patch @@ -0,0 +1,26 @@ +From ac4bf86bb65a1e228550cce9314ad17239343c5d Mon Sep 17 00:00:00 2001 +From: Werner Koch +Date: Tue, 21 May 2024 14:36:07 +0200 +Subject: [PATCH] tests: Fix segv in t-json.c + +* tests/json/t-json.c (test_contains): Avoid calling recusivly with no child. +--- + tests/json/t-json.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/json/t-json.c b/tests/json/t-json.c +index e1fb6c1..105b981 100644 +--- a/tests/json/t-json.c ++++ b/tests/json/t-json.c +@@ -258,7 +258,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; + for (cjson_t hit = hay->child; hit; hit = hit->next) +-- +2.33.0 + diff --git a/gpgme.spec b/gpgme.spec index f9ca63f..794c4cc 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,6 +1,6 @@ Name: gpgme Version: 1.14.0 -Release: 2 +Release: 3 Summary: GnuPG Made Easy License: GPLv2+ and LGPLv2+ URL: https://gnupg.org/related_software/gpgme/ @@ -13,6 +13,7 @@ Patch6000: 0001-don-t-add-extra-libraries-for-linking.patch Patch6001: gpgme-1.3.2-largefile.patch # Let's fix stupid AX_PYTHON_DEVEL Patch6002: 0001-fix-stupid-ax_python_devel.patch +Patch6003: backport-tests-Fix-segv-in-t-json.c.patch BuildRequires: autoconf automake gcc gcc-c++ gawk gnupg2 >= 2.1.18 BuildRequires: libgpg-error-devel >= 1.24 libassuan-devel >= 2.4.2 @@ -161,6 +162,9 @@ fi %changelog +* Fri Oct 18 2024 yixiangzhike - 1.14.0-3 +- fix segv in t-json.c + * Thu May 30 2024 yixiangzhike - 1.14.0-2 - add gpgme.pc file