aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_hash.c')
-rw-r--r--src/core/ngx_hash.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
index 911781f4b..f0c167eaf 100644
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -889,10 +889,15 @@ wildcard:
/* convert "www.example.*" to "www.example\0" */
- p = key->data;
- key->data[last] = '\0';
last++;
+ p = ngx_palloc(ha->temp_pool, last);
+ if (p == NULL) {
+ return NGX_ERROR;
+ }
+
+ ngx_cpystrn(p, key->data, last - 1);
+
hwc = &ha->dns_wc_tail;
keys = &ha->dns_wc_tail_hash[k];
}