From: Igor Sysoev Date: Mon, 6 Apr 2009 10:38:40 +0000 (+0000) Subject: fix ngx_strlcasestrn() X-Git-Tag: release-0.7.49~1 X-Git-Url: http://git.kaiwu.me/sitemap.xml?a=commitdiff_plain;h=f3aed53c9d6d2cd3a54d3c5c66ae0f8e0deecc5e;p=nginx.git fix ngx_strlcasestrn() --- diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index fbde1c2ce..8f2a17159 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -703,6 +703,10 @@ 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;