Merge of r4268:
Fixed compression pointer processing in DNS response greater than 255 bytes. Thanks to Ben Hawkes.
This commit is contained in:
parent
ad866a4e60
commit
8b346e57ee
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue