diff --git a/apr.spec b/apr.spec index a7954f9cdc8f328a827c57a5b3e1f1b5da564df9..d9ac81801e253138bd9e2f8fd961b5fbe6dc3034 100644 --- a/apr.spec +++ b/apr.spec @@ -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 - 1.7.4-3 +- fix segfaults error + * Tue Feb 20 2024 liweigang - 1.7.4-2 - modify changelog format and delete unused source diff --git a/backport-memory-unix-apr_pools.c-apr_pool_cleanup_register.patch b/backport-memory-unix-apr_pools.c-apr_pool_cleanup_register.patch new file mode 100644 index 0000000000000000000000000000000000000000..b7f32424af1a642240758bfd84ff45e9f998f204 --- /dev/null +++ b/backport-memory-unix-apr_pools.c-apr_pool_cleanup_register.patch @@ -0,0 +1,36 @@ +From 54bc039ca9781c75b51ad39a01ae79d30efd6f09 Mon Sep 17 00:00:00 2001 +From: Rainer Jung +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 +