]> git.kaiwu.me - nginx.git/commitdiff
Merge of r4644:
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Jul 2012 15:35:22 +0000 (15:35 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 2 Jul 2012 15:35:22 +0000 (15:35 +0000)
Fixed potential null pointer dereference in ngx_resolver_create().
While here, improved error message.

src/core/ngx_resolver.c

index edc43dce21992da37188a1ed6cdea6561a60b30c..54bd384e859667602454da9e51836fc5c6daebca 100644 (file)
@@ -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;
         }