diff options
author | nginx <nginx@nginx.org> | 2015-04-07 16:06:25 +0000 |
---|---|---|
committer | Jon Kolb <kolbyjack@gmail.com> | 2015-04-07 16:06:25 +0000 |
commit | 72e45e044fbfeab626688498132d6a3bed24bf70 (patch) | |
tree | df621b5510d9d830b1a79bb006c2126e1346d650 /src/core/ngx_inet.c | |
parent | ab9c4cd3a4ed13f61ae572c15042df84d5fb9418 (diff) | |
download | nginx-1.6.tar.gz |
*) Feature: now the "tcp_nodelay" directive works with SPDY connections.
*) Bugfix: in error handling.
Thanks to Yichun Zhang and Daniil Bondarev.
*) Bugfix: alerts "header already sent" appeared in logs if the
"post_action" directive was used; the bug had appeared in 1.5.4.
*) Bugfix: alerts "sem_post() failed" might appear in logs.
*) Bugfix: in hash table handling.
Thanks to Chris West.
*) Bugfix: in integer overflow handling.
Thanks to Régis Leroy.
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r-- | src/core/ngx_inet.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 26c5bc4b0..2c84daf6e 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -27,6 +27,10 @@ ngx_inet_addr(u_char *text, size_t len) for (p = text; p < text + len; p++) { + if (octet > 255) { + return INADDR_NONE; + } + c = *p; if (c >= '0' && c <= '9') { @@ -34,7 +38,7 @@ ngx_inet_addr(u_char *text, size_t len) continue; } - if (c == '.' && octet < 256) { + if (c == '.') { addr = (addr << 8) + octet; octet = 0; n++; @@ -44,7 +48,7 @@ ngx_inet_addr(u_char *text, size_t len) return INADDR_NONE; } - if (n == 3 && octet < 256) { + if (n == 3) { addr = (addr << 8) + octet; return htonl(addr); } |