comparison src/http/ngx_http_upstream.c @ 7067:e3723f2a11b7

Parenthesized ASCII-related calculations. This also fixes potential undefined behaviour in the range and slice filter modules, caused by local overflows of signed integers in expressions.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 17 Jul 2017 17:23:51 +0300
parents bd2f97a3aecc
children f583559aadc7
comparison
equal deleted inserted replaced
7066:a27e0c7e198c 7067:e3723f2a11b7
4501 if (*p == ',' || *p == ';' || *p == ' ') { 4501 if (*p == ',' || *p == ';' || *p == ' ') {
4502 break; 4502 break;
4503 } 4503 }
4504 4504
4505 if (*p >= '0' && *p <= '9') { 4505 if (*p >= '0' && *p <= '9') {
4506 n = n * 10 + *p - '0'; 4506 n = n * 10 + (*p - '0');
4507 continue; 4507 continue;
4508 } 4508 }
4509 4509
4510 u->cacheable = 0; 4510 u->cacheable = 0;
4511 return NGX_OK; 4511 return NGX_OK;
4529 if (*p == ',' || *p == ';' || *p == ' ') { 4529 if (*p == ',' || *p == ';' || *p == ' ') {
4530 break; 4530 break;
4531 } 4531 }
4532 4532
4533 if (*p >= '0' && *p <= '9') { 4533 if (*p >= '0' && *p <= '9') {
4534 n = n * 10 + *p - '0'; 4534 n = n * 10 + (*p - '0');
4535 continue; 4535 continue;
4536 } 4536 }
4537 4537
4538 u->cacheable = 0; 4538 u->cacheable = 0;
4539 return NGX_OK; 4539 return NGX_OK;
4552 if (*p == ',' || *p == ';' || *p == ' ') { 4552 if (*p == ',' || *p == ';' || *p == ' ') {
4553 break; 4553 break;
4554 } 4554 }
4555 4555
4556 if (*p >= '0' && *p <= '9') { 4556 if (*p >= '0' && *p <= '9') {
4557 n = n * 10 + *p - '0'; 4557 n = n * 10 + (*p - '0');
4558 continue; 4558 continue;
4559 } 4559 }
4560 4560
4561 u->cacheable = 0; 4561 u->cacheable = 0;
4562 return NGX_OK; 4562 return NGX_OK;