From: Andrey Volk Date: Thu, 20 Feb 2020 19:20:53 +0000 (+0400) Subject: [apr] scan-build: fix dereference of null pointer in apr_hash_merge() and apr_proc_ot... X-Git-Tag: v1.10.3^2~134^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e39eb286293d273d59449b32061fe7a1bc705d2c;p=thirdparty%2Ffreeswitch.git [apr] scan-build: fix dereference of null pointer in apr_hash_merge() and apr_proc_other_child_unregister() --- diff --git a/libs/apr/misc/unix/otherchild.c b/libs/apr/misc/unix/otherchild.c index 427a57e7e4..c97cfdd644 100644 --- a/libs/apr/misc/unix/otherchild.c +++ b/libs/apr/misc/unix/otherchild.c @@ -96,7 +96,7 @@ APR_DECLARE(void) apr_proc_other_child_unregister(void *data) } /* segfault if this function called with invalid parm */ - apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup); + if (cur) apr_pool_cleanup_kill(cur->p, cur->data, other_child_cleanup); other_child_cleanup(data); } diff --git a/libs/apr/tables/apr_hash.c b/libs/apr/tables/apr_hash.c index 4e3723e19f..5cac297af9 100644 --- a/libs/apr/tables/apr_hash.c +++ b/libs/apr/tables/apr_hash.c @@ -459,7 +459,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p, break; } } - if (!ent) { + if (new_vals && !ent) { new_vals[j].klen = iter->klen; new_vals[j].key = iter->key; new_vals[j].val = iter->val;