!35 [sync] PR-31: 【openEuler-22.03-LTS-SP1】Fix segv in t-json.c

From: @openeuler-sync-bot 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
This commit is contained in:
openeuler-ci-bot 2024-11-04 02:06:51 +00:00 committed by Gitee
commit 9f9dc78896
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
Version: 1.16.0
Release: 3
Release: 4
Summary: GnuPG Made Easy
License: GPLv2+ and LGPLv2+
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
Patch2: 0001-fix-stupid-ax_python_devel.patch
Patch3: backport-core-Support-closefrom-also-for-glibc.patch
Patch4: backport-tests-Fix-segv-in-t-json.c.patch
BuildRequires: autoconf automake gcc gcc-c++ gawk gnupg2 >= 2.2.24
BuildRequires: libgpg-error-devel >= 1.36 libassuan-devel >= 2.4.2
@ -146,6 +147,12 @@ fi
%changelog
* Fri Oct 18 2024 yixiangzhike <yixiangzhike007@163.com> - 1.16.0-4
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix segv in t-json.c
* Wed Mar 6 2024 yixiangzhike <yixiangzhike007@163.com> - 1.16.0-3
- Type:bugfix
- CVE:NA