Merge pull request #399 from signalwire/apr_hash

[apr] scan-build: fix dereference of null pointer in apr_hash_merge() and apr_proc_other_child_unregister()
This commit is contained in:
Andrey Volk 2020-02-20 23:30:56 +04:00 committed by GitHub
commit f44052be0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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;