Fix segv in t-json.c

This commit is contained in:
yixiangzhike 2024-10-18 16:31:00 +08:00
parent accfa495ec
commit 3091811d18
2 changed files with 31 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From ac4bf86bb65a1e228550cce9314ad17239343c5d Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
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

View File

@ -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 <yixiangzhike007@163.com> - 1.14.0-3
- fix segv in t-json.c
* Thu May 30 2024 yixiangzhike <yixiangzhike007@163.com> - 1.14.0-2
- add gpgme.pc file