[apr] scan-build: Dereference of null pointer in apr_hash_merge()

This commit is contained in:
Andrey Volk 2021-04-19 23:27:14 +03:00
parent cba582cf4a
commit d6884d6871
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,8 @@
#include <string.h>
#endif
#include <assert.h> /* assert() */
#if APR_POOL_DEBUG && APR_HAVE_STDIO_H
#include <stdio.h>
#endif
@ -433,6 +435,7 @@ APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
for (k = 0; k <= base->max; k++) {
for (iter = base->array[k]; iter; iter = iter->next) {
i = iter->hash & res->max;
assert(new_vals);
new_vals[j].klen = iter->klen;
new_vals[j].key = iter->key;
new_vals[j].val = iter->val;