diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-08-24 15:05:47 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-08-24 15:05:47 +0400 |
commit | 43f3aead1456eb8199c73660417647ce1b5c59a6 (patch) | |
tree | b6f0ceb43378cb0b966809ca220413a3e6beba18 /src/core/ngx_hash.c | |
parent | 293ba66ebaeeea50a855c0941c5cac4cf705dc89 (diff) |
fix trailing wildcard when two or more listen used in one server
Diffstat (limited to 'src/core/ngx_hash.c')
-rw-r--r-- | src/core/ngx_hash.c | 9 |
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]; } |