mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
fix resolving an empty name (".")
This commit is contained in:
parent
61da56d041
commit
e79f429b4b
@ -1719,13 +1719,14 @@ static ngx_int_t
|
||||
ngx_resolver_create_name_query(ngx_resolver_node_t *rn, ngx_resolver_ctx_t *ctx)
|
||||
{
|
||||
u_char *p, *s;
|
||||
size_t len;
|
||||
size_t len, nlen;
|
||||
ngx_uint_t ident;
|
||||
ngx_resolver_qs_t *qs;
|
||||
ngx_resolver_query_t *query;
|
||||
|
||||
len = sizeof(ngx_resolver_query_t)
|
||||
+ 1 + ctx->name.len + 1 + sizeof(ngx_resolver_qs_t);
|
||||
nlen = ctx->name.len ? (1 + ctx->name.len + 1) : 1;
|
||||
|
||||
len = sizeof(ngx_resolver_query_t) + nlen + sizeof(ngx_resolver_qs_t);
|
||||
|
||||
p = ngx_resolver_calloc(ctx->resolver, len);
|
||||
if (p == NULL) {
|
||||
@ -1754,8 +1755,7 @@ ngx_resolver_create_name_query(ngx_resolver_node_t *rn, ngx_resolver_ctx_t *ctx)
|
||||
query->nns_hi = 0; query->nns_lo = 0;
|
||||
query->nar_hi = 0; query->nar_lo = 0;
|
||||
|
||||
p += sizeof(ngx_resolver_query_t)
|
||||
+ ctx->name.len ? (1 + ctx->name.len + 1) : 1;
|
||||
p += sizeof(ngx_resolver_query_t) + nlen;
|
||||
|
||||
qs = (ngx_resolver_qs_t *) p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user