comparison src/core/ngx_string.c @ 476:09b45263c817 NGINX_0_7_50

nginx 0.7.50 *) Change: a segmentation fault might occur in worker process, if the $arg_... variables were used; the bug had appeared in 0.7.48.
author Igor Sysoev <http://sysoev.ru>
date Mon, 06 Apr 2009 00:00:00 +0400
parents 3a4102b00f97
children ed5e10fb40fc
comparison
equal deleted inserted replaced
475:aed0c0cf845d 476:09b45263c817
701 u_char * 701 u_char *
702 ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n) 702 ngx_strlcasestrn(u_char *s1, u_char *last, u_char *s2, size_t n)
703 { 703 {
704 ngx_uint_t c1, c2; 704 ngx_uint_t c1, c2;
705 705
706 if (s1 <= last) {
707 return NULL;
708 }
709
710 c2 = (ngx_uint_t) *s2++; 706 c2 = (ngx_uint_t) *s2++;
711 c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2; 707 c2 = (c2 >= 'A' && c2 <= 'Z') ? (c2 | 0x20) : c2;
712 last -= n; 708 last -= n;
713 709
714 do { 710 do {
715 do { 711 do {
716 if (s1 == last) { 712 if (s1 >= last) {
717 return NULL; 713 return NULL;
718 } 714 }
719 715
720 c1 = (ngx_uint_t) *s1++; 716 c1 = (ngx_uint_t) *s1++;
721 717