Fixed compression pointer processing in DNS response greater than 255 bytes.
Thanks to Ben Hawkes.
This commit is contained in:
parent
a1f95cd5d6
commit
6cc6ee5f71
1 changed files with 7 additions and 7 deletions
|
@ -1952,7 +1952,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;
|
||||
|
@ -1962,12 +1968,6 @@ done:
|
|||
if (n != 0) {
|
||||
*dst++ = '.';
|
||||
}
|
||||
|
||||
} else {
|
||||
n = ((n & 0x3f) << 8) + *src;
|
||||
src = &buf[n];
|
||||
|
||||
n = *src++;
|
||||
}
|
||||
|
||||
if (n == 0) {
|
||||
|
|
Loading…
Reference in a new issue