apr/memory-unix-apr_pools.c-apr_pool_cleanup_register.patch
2020-06-30 17:26:36 +08:00

34 lines
988 B
Diff

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
---
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 524e9ac..3361f7a 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -2484,6 +2484,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) {
--
1.8.3.1