~ubuntu-branches/ubuntu/raring/nginx/raring-proposed

« back to all changes in this revision

Viewing changes to debian/patches/607418-ipv6-addresses.diff

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Michael Lustfield
  • Date: 2011-12-14 09:45:40 UTC
  • mfrom: (1.1.27)
  • Revision ID: package-import@ubuntu.com-20111214094540-kdlo7qnrpm73l2rn
Tags: 1.1.11-1
[Kartik Mistry]
* New upstream release.
* debian/control:
  + Set priority to extra for nginx-light and nginx-extras binaries
    (Policy: Section 2.5)
* debian/patches/607418-ipv6-addresses.diff:
  + Removed. Merged upstream with 1.1.9 release.
* debian/copyright:
  + Updated upstream copyright year, updated Michael's email address, misc
    changes for format.

[Michael Lustfield]
* debian/conf/fastcgi_params:
  + Changed $server_https to $https per new feature in 1.1.11.
* debian/conf/nginx.conf:
  + Removed map for $server_https as it's no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
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 @@
11
 
 {
12
 
     u_char      *h, ch;
13
 
     size_t       i, last;
14
 
-    ngx_uint_t   dot;
15
 
+    ngx_uint_t   dot, in_brackets;
16
 
 
17
 
     last = len;
18
 
     h = *host;
19
 
     dot = 0;
20
 
+    in_brackets = 0;
21
 
 
22
 
     for (i = 0; i < len; i++) {
23
 
         ch = h[i];
24
 
@@ -1670,11 +1671,27 @@
25
 
 
26
 
         dot = 0;
27
 
 
28
 
-        if (ch == ':') {
29
 
+        if (ch == '[' && i == 0) {
30
 
+            /* start of literal IPv6 address */
31
 
+            in_brackets = 1;
32
 
+            continue;
33
 
+        }
34
 
+
35
 
+        /*
36
 
+         * Inside square brackets, the colon is a delimeter for an IPv6 address.
37
 
+         * Otherwise it comes before the port number, so remove it.
38
 
+         */
39
 
+        if (ch == ':' && !in_brackets) {
40
 
             last = i;
41
 
             continue;
42
 
         }
43
 
 
44
 
+        if (ch == ']') {
45
 
+            /* end of literal IPv6 address */
46
 
+            in_brackets = 0;
47
 
+            continue;
48
 
+        }
49
 
+
50
 
         if (ngx_path_separator(ch) || ch == '\0') {
51
 
             return 0;
52
 
         }
53
 
@@ -1684,6 +1701,11 @@
54
 
         }
55
 
     }
56
 
 
57
 
+    if (in_brackets) {
58
 
+        /* missing the closing square bracket for IPv6 address */
59
 
+        return 0;
60
 
+    }
61
 
+
62
 
     if (dot) {
63
 
         last--;
64
 
     }