comparison src/core/ngx_resolver.c @ 6347:81d44cd4044e

Resolver: fixed possible segmentation fault on DNS format error.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 26 Jan 2016 16:46:18 +0300
parents c3ec43580a48
children 7316c57e4fe7
comparison
equal deleted inserted replaced
6336:02abce4764b7 6347:81d44cd4044e
1310 if (code == NGX_RESOLVE_FORMERR) { 1310 if (code == NGX_RESOLVE_FORMERR) {
1311 1311
1312 times = 0; 1312 times = 0;
1313 1313
1314 for (q = ngx_queue_head(&r->name_resend_queue); 1314 for (q = ngx_queue_head(&r->name_resend_queue);
1315 q != ngx_queue_sentinel(&r->name_resend_queue) || times++ < 100; 1315 q != ngx_queue_sentinel(&r->name_resend_queue) && times++ < 100;
1316 q = ngx_queue_next(q)) 1316 q = ngx_queue_next(q))
1317 { 1317 {
1318 rn = ngx_queue_data(q, ngx_resolver_node_t, queue); 1318 rn = ngx_queue_data(q, ngx_resolver_node_t, queue);
1319 qident = (rn->query[0] << 8) + rn->query[1]; 1319 qident = (rn->query[0] << 8) + rn->query[1];
1320 1320