diff options
author | Ruediger Pluem <rpluem@apache.org> | 2012-08-03 07:41:38 +0000 |
---|---|---|
committer | Ruediger Pluem <rpluem@apache.org> | 2012-08-03 07:41:38 +0000 |
commit | 38f0619e23f1405400618851fef7eaeb29fbd2b8 (patch) | |
tree | cb5163ac2c76644e852d96610a9b5a9e1f70e02a | |
parent | 554d342ab623b1d99e3024ab2b20dda1c1710987 (diff) | |
download | apr-38f0619e23f1405400618851fef7eaeb29fbd2b8.tar.gz |
Merge r1367050 from trunk:
* Prevent apr_table_mergen from aborting when APR_POOL_DEBUG is set and key or
value are static literals not stored in pool managed memory.
Submitted by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.5.x@1368813 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | tables/apr_tables.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c index 51b23407c..683f48a16 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -730,15 +730,18 @@ APR_DECLARE(void) apr_table_mergen(apr_table_t *t, const char *key, apr_table_entry_t *next_elt; apr_table_entry_t *end_elt; apr_uint32_t checksum; + apr_pool_t *pool; int hash; #if APR_POOL_DEBUG { - if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) { + pool = apr_pool_find(key); + if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n"); abort(); } - if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) { + pool = apr_pool_find(val); + if ((pool != val) && (!apr_pool_is_ancestor(pool, t->a.pool))) { fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n"); abort(); } |