File: 0003-Resolver-fixed-possible-segmentation-fault-on-DNS-fo.patch

package info (click to toggle)
nginx 1.6.2-5+deb8u1~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 13,340 kB
  • sloc: ansic: 144,236; perl: 7,373; sh: 1,325; ruby: 789; makefile: 137; asm: 48; awk: 36; cpp: 18
file content (21 lines) | stat: -rw-r--r-- 834 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: Roman Arutyunyan <arut@nginx.com>
Date: Tue, 26 Jan 2016 16:46:18 +0300
Subject: Resolver: fixed possible segmentation fault on DNS format error.

---
 src/core/ngx_resolver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index 5a944fc..726de9b 100644
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -1287,7 +1287,7 @@ ngx_resolver_process_response(ngx_resolver_t *r, u_char *buf, size_t n)
         times = 0;
 
         for (q = ngx_queue_head(&r->name_resend_queue);
-             q != ngx_queue_sentinel(&r->name_resend_queue) || times++ < 100;
+             q != ngx_queue_sentinel(&r->name_resend_queue) && times++ < 100;
              q = ngx_queue_next(q))
         {
             rn = ngx_queue_data(q, ngx_resolver_node_t, queue);