Klaus Demo nginx / 53d9677
Fixed null pointer dereference in resolver (ticket #91). The cycle->new_log.file may not be set before config parsing finished if there are no error_log directive defined at global level. Fix is to copy it after config parsing. Patch by Roman Arutyunyan. Maxim Dounin 10 years ago
1 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
188188 uc->sockaddr = u.addrs->sockaddr;
189189 uc->socklen = u.addrs->socklen;
190190 uc->server = u.addrs->name;
191
192 uc->log = cf->cycle->new_log;
193 uc->log.handler = ngx_resolver_log_error;
194 uc->log.data = uc;
195 uc->log.action = "resolving";
196191 }
197192
198193 return r;
875870 }
876871
877872 if (uc->connection == NULL) {
873
874 uc->log = *r->log;
875 uc->log.handler = ngx_resolver_log_error;
876 uc->log.data = uc;
877 uc->log.action = "resolving";
878
878879 if (ngx_udp_connect(uc) != NGX_OK) {
879880 return NGX_ERROR;
880881 }