Mercurial > hg > nginx-quic
diff src/core/ngx_resolver.c @ 4287:7740d2a8d55b stable-1.0
Merge of r4268:
Fixed compression pointer processing in DNS response greater than 255 bytes.
Thanks to Ben Hawkes.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 14 Nov 2011 16:12:25 +0000 |
parents | 159b58f9c0bd |
children | 4919fb357a5d |
line wrap: on
line diff
--- a/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c @@ -1922,7 +1922,13 @@ done: n = *src++; for ( ;; ) { - if (n != 0xc0) { + if (n & 0xc0) { + n = ((n & 0x3f) << 8) + *src; + src = &buf[n]; + + n = *src++; + + } else { ngx_memcpy(dst, src, n); dst += n; src += n; @@ -1932,12 +1938,6 @@ done: if (n != 0) { *dst++ = '.'; } - - } else { - n = ((n & 0x3f) << 8) + *src; - src = &buf[n]; - - n = *src++; } if (n == 0) {