!37 fix segfaults error

From: @wangjiang37 
Reviewed-by: @pshysimon, @gaoruoshu 
Signed-off-by: @gaoruoshu
This commit is contained in:
openeuler-ci-bot 2024-08-14 06:14:15 +00:00 committed by Gitee
commit 6255126dfa
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 41 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Name: apr
Version: 1.7.4
Release: 2
Release: 3
Summary: Apache Portable Runtime.
License: ASL 2.0 and BSD with advertising and ISC and BSD
URL: http://apr.apache.org
@ -11,6 +11,7 @@ Source1: apr-wrapper.h
Patch0: apr-1.2.2-libdir.patch
Patch1: apr-1.2.7-pkgconf.patch
Patch2: backport-memory-unix-apr_pools.c-apr_pool_cleanup_register.patch
BuildRequires: gcc autoconf libtool libuuid-devel python3 lksctp-tools-devel
@ -94,6 +95,9 @@ make check
%doc docs/incomplete_types docs/non_apr_programs
%changelog
* Tue Aug 13 2024 wangjiang <wangjiang37@h-partners.com> - 1.7.4-3
- fix segfaults error
* Tue Feb 20 2024 liweigang <izmirvii@gmail.com> - 1.7.4-2
- modify changelog format and delete unused source

View File

@ -0,0 +1,36 @@
From 54bc039ca9781c75b51ad39a01ae79d30efd6f09 Mon Sep 17 00:00:00 2001
From: Rainer Jung <rjung@apache.org>
Date: Wed, 17 Jul 2019 11:15:08 +0000
Subject: [PATCH] * memory/unix/apr_pools.c (apr_pool_cleanup_register):
[APR_POOL_DEBUG]: Catch NULL arguments which would lead to strange
segfaults later.
Backport of r1082177 from trunk.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1863198 13f79535-47bb-0310-9956-ffa450edef68
Reference:https://github.com/apache/apr/commit/54bc039ca9781c75b51ad39a01ae79d30efd6f09
Conflict:NA
---
memory/unix/apr_pools.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 524e9acb4..3361f7a7d 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -2509,6 +2509,10 @@ APR_DECLARE(void) apr_pool_cleanup_register(apr_pool_t *p, const void *data,
#if APR_POOL_DEBUG
apr_pool_check_integrity(p);
+
+ if (!p || !plain_cleanup_fn || !child_cleanup_fn) {
+ abort();
+ }
#endif /* APR_POOL_DEBUG */
if (p != NULL) {
--
2.23.0