!33 [sync] PR-30: 【Mainline】Fix segv in t-json.c

From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-10-21 03:45:20 +00:00 committed by Gitee
commit 94d8bf5987
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
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 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;
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: gpgme Name: gpgme
Version: 1.21.0 Version: 1.21.0
Release: 1 Release: 2
Summary: GnuPG Made Easy Summary: GnuPG Made Easy
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://gnupg.org/related_software/gpgme/ URL: https://gnupg.org/related_software/gpgme/
@ -14,6 +14,7 @@ Patch1: gpgme-1.3.2-largefile.patch
# Let's fix stupid AX_PYTHON_DEVEL # Let's fix stupid AX_PYTHON_DEVEL
Patch2: 0001-fix-stupid-ax_python_devel.patch Patch2: 0001-fix-stupid-ax_python_devel.patch
Patch3: backport-0002-setup_py_extra_opts.patch Patch3: backport-0002-setup_py_extra_opts.patch
Patch4: backport-tests-Fix-segv-in-t-json.c.patch
BuildRequires: autoconf automake gcc gcc-c++ gawk gnupg2 >= 2.2.24 BuildRequires: autoconf automake gcc gcc-c++ gawk gnupg2 >= 2.2.24
BuildRequires: libgpg-error-devel >= 1.36 libassuan-devel >= 2.4.2 BuildRequires: libgpg-error-devel >= 1.36 libassuan-devel >= 2.4.2
@ -148,6 +149,12 @@ fi
%changelog %changelog
* Fri Oct 18 2024 yixiangzhike <yixiangzhike007@163.com> - 1.21.0-2
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix segv in t-json.c
* Mon Jul 17 2023 yixiangzhike <yixiangzhike007@163.com> - 1.21.0-1 * Mon Jul 17 2023 yixiangzhike <yixiangzhike007@163.com> - 1.21.0-1
- Type:bugfix - Type:bugfix
- CVE:NA - CVE:NA