1
Description: $host variable mis-parses IPv6 literal addresses from HTTP
2
Author: Steven Chamberlain <steven@pyro.eu.org>
3
Debian-Bug: http://bugs.debian.org/607418
4
Last-Update: 2010-12-30
6
Index: trunk/src/http/ngx_http_request.c
7
===================================================================
8
--- trunk.orig/src/http/ngx_http_request.c 2010-12-30 01:46:10.308926973 -0600
9
+++ trunk/src/http/ngx_http_request.c 2010-12-30 01:48:21.638927393 -0600
10
@@ -1650,11 +1650,12 @@
15
+ ngx_uint_t dot, in_brackets;
22
for (i = 0; i < len; i++) {
24
@@ -1670,11 +1671,27 @@
29
+ if (ch == '[' && i == 0) {
30
+ /* start of literal IPv6 address */
36
+ * Inside square brackets, the colon is a delimeter for an IPv6 address.
37
+ * Otherwise it comes before the port number, so remove it.
39
+ if (ch == ':' && !in_brackets) {
45
+ /* end of literal IPv6 address */
50
if (ngx_path_separator(ch) || ch == '\0') {
53
@@ -1684,6 +1701,11 @@
58
+ /* missing the closing square bracket for IPv6 address */