mirror of
https://github.com/nginx/nginx.git
synced 2024-11-26 10:50:18 -06:00
Fixed potential null pointer dereference in ngx_resolver_create().
While here, improved error message.
This commit is contained in:
parent
d230df40b2
commit
d2e005c39d
@ -175,7 +175,12 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
|
||||
u.port = 53;
|
||||
|
||||
if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
|
||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err);
|
||||
if (u.err) {
|
||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||
"%s in resolver \"%V\"",
|
||||
u.err, &u.host);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user