comparison src/core/ngx_string.c @ 364:a39aab45a53f NGINX_0_6_26

nginx 0.6.26 *) Bugfix: the "proxy_store" and "fastcgi_store" directives did not check a response length. *) Bugfix: a segmentation fault occurred in worker process, if big value was used in a "expires" directive. Thanks to Joaquin Cuenca Abela. *) Bugfix: nginx incorrectly detected cache line size on Pentium 4. Thanks to Gena Makhomed. *) Bugfix: in proxied or FastCGI subrequests a client original method was used instead of the GET method. *) Bugfix: socket leak in HTTPS mode if deferred accept was used. Thanks to Ben Maurer. *) Bugfix: nginx issued the bogus error message "SSL_shutdown() failed (SSL: )"; bug appeared in 0.6.23. *) Bugfix: in HTTPS mode requests might fail with the "bad write retry" error; bug appeared in 0.6.23.
author Igor Sysoev <http://sysoev.ru>
date Mon, 11 Feb 2008 00:00:00 +0300
parents 9121a0a91f47
children 6639b93e81b2
comparison
equal deleted inserted replaced
363:6999caedb665 364:a39aab45a53f
145 zero = (u_char) ((*++fmt == '0') ? '0' : ' '); 145 zero = (u_char) ((*++fmt == '0') ? '0' : ' ');
146 width = 0; 146 width = 0;
147 sign = 1; 147 sign = 1;
148 hexadecimal = 0; 148 hexadecimal = 0;
149 max_width = 0; 149 max_width = 0;
150 slen = 0; 150 slen = (size_t) -1;
151 151
152 p = temp + NGX_INT64_LEN; 152 p = temp + NGX_INT64_LEN;
153 153
154 while (*fmt >= '0' && *fmt <= '9') { 154 while (*fmt >= '0' && *fmt <= '9') {
155 width = width * 10 + *fmt++ - '0'; 155 width = width * 10 + *fmt++ - '0';
180 sign = 0; 180 sign = 0;
181 fmt++; 181 fmt++;
182 continue; 182 continue;
183 183
184 case '*': 184 case '*':
185 slen = va_arg(args, u_int); 185 slen = va_arg(args, size_t);
186 fmt++; 186 fmt++;
187 continue; 187 continue;
188 188
189 default: 189 default:
190 break; 190 break;
219 continue; 219 continue;
220 220
221 case 's': 221 case 's':
222 p = va_arg(args, u_char *); 222 p = va_arg(args, u_char *);
223 223
224 if (slen == 0) { 224 if (slen == (size_t) -1) {
225 while (*p && buf < last) { 225 while (*p && buf < last) {
226 *buf++ = *p++; 226 *buf++ = *p++;
227 } 227 }
228 228
229 } else { 229 } else {
230 buf = ngx_cpymem(buf, p, slen); 230 len = (buf + slen < last) ? slen : (size_t) (last - buf);
231
232 buf = ngx_cpymem(buf, p, len);
231 } 233 }
232 234
233 fmt++; 235 fmt++;
234 236
235 continue; 237 continue;