]> git.kaiwu.me - nginx.git/commitdiff
backout r2677 and fix ngx_strlcasestrn() again
authorIgor Sysoev <igor@sysoev.ru>
Mon, 6 Apr 2009 11:42:42 +0000 (11:42 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 6 Apr 2009 11:42:42 +0000 (11:42 +0000)
src/core/ngx_string.c

index 8f2a17159df346c83b895de2aa78191983899512..9b63891a8641c05033baac81dfe7dc3b7ba1e410 100644 (file)
@@ -703,17 +703,13 @@ ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n)
 {
     ngx_uint_t  c1, c2;
 
-    if (s1 <= last) {
-        return NULL;
-    }
-
     c2 = (ngx_uint_t) *s2++;
     c2  = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
     last -= n;
 
     do {
         do {
-            if (s1 == last) {
+            if (s1 >= last) {
                 return NULL;
             }