]> git.kaiwu.me - nginx.git/commitdiff
fix compression pointer for big (>255) DNS responses
authorIgor Sysoev <igor@sysoev.ru>
Mon, 17 Nov 2008 08:04:41 +0000 (08:04 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 17 Nov 2008 08:04:41 +0000 (08:04 +0000)
src/core/ngx_resolver.c

index f4bbe19d45f38b872112767ae05cb5521aeab55a..05b44c7719ae36be98421cd0695ef8fafdc19843 100644 (file)
@@ -1866,7 +1866,7 @@ ngx_resolver_copy(ngx_resolver_t *r, ngx_str_t *name, u_char *buf, u_char *src,
         }
 
         if (n & 0xc0) {
-            n = (n & 0x3f << 8) + *p;
+            n = ((n & 0x3f) << 8) + *p;
             p = &buf[n];
 
         } else {
@@ -1916,7 +1916,7 @@ done:
             }
 
         } else {
-            n = (n & 0x3f << 8) + *src;
+            n = ((n & 0x3f) << 8) + *src;
             src = &buf[n];
 
             n = *src++;