diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-18 21:57:35 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2002-01-18 21:57:35 +0000 |
commit | d9af7a4cb0146b10e206e31418ce69737ce9e60e (patch) | |
tree | 12e2da12509b86794abeb709c68c3d96b8682b48 /tables | |
parent | fe22fd351eb48972691eb091ca726b6f026ecb3f (diff) | |
download | libapr-d9af7a4cb0146b10e206e31418ce69737ce9e60e.tar.gz |
for the call to apr_table_overlap where it has no work to do:
avoid some logic in apr_table_overlap which dies with
APR_POOL_DEBUG+ElectricFence since it tries to alloc zero
bytes
it is useful to bail out early anyway to avoid some needless
function calls and other
Requesting CGI scripts through Apache causes such a call (maybe
just for HTTP/0.9? I dunno.).
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62808 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tables')
-rw-r--r-- | tables/apr_tables.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c index c8095a723..0f571a0fe 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -935,6 +935,18 @@ APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, apr_table_entry_t *elts; max_keys = a->a.nelts + b->a.nelts; + if (!max_keys) { + /* The following logic won't do anything harmful if we keep + * going in this situation, but + * + * 1) certain memory debuggers don't like an alloc size of 0 + * so we'd like to avoid that... + * 2) this isn't all that rare a call anyway, so it is useful + * to skip the storage allocation and other checks in the + * following logic + */ + return; + } cat_keys = apr_palloc(b->a.pool, sizeof(overlap_key) * max_keys); nhash = DEFAULT_HASH_SIZE; while (nhash < max_keys) { |