Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4268 - trunk/src/core

November 09, 2011 08:56AM
Author: is
Date: 2011-11-09 13:54:07 +0000 (Wed, 09 Nov 2011)
New Revision: 4268

Modified:
trunk/src/core/ngx_resolver.c
Log:
Fixed compression pointer processing in DNS response greater than 255 bytes.

Thanks to Ben Hawkes.


Modified: trunk/src/core/ngx_resolver.c
===================================================================
--- trunk/src/core/ngx_resolver.c 2011-11-08 13:48:23 UTC (rev 4267)
+++ trunk/src/core/ngx_resolver.c 2011-11-09 13:54:07 UTC (rev 4268)
@@ -1952,7 +1952,13 @@
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 @@
if (n != 0) {
*dst++ = '.';
}
-
- } else {
- n = ((n & 0x3f) << 8) + *src;
- src = &buf[n];
-
- n = *src++;
}

if (n == 0) {

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4268 - trunk/src/core

Igor Sysoev 1203 November 09, 2011 08:56AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 68
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready