mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Fixed invalid access to complex value defined as an empty string.
Found by Valgrind.
This commit is contained in:
parent
51df7912c4
commit
99bf1b56ec
@ -378,7 +378,7 @@ ngx_http_parse_expires(ngx_str_t *value, ngx_http_expires_t *expires,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value->data[0] == '@') {
|
if (value->len && value->data[0] == '@') {
|
||||||
value->data++;
|
value->data++;
|
||||||
value->len--;
|
value->len--;
|
||||||
minus = 0;
|
minus = 0;
|
||||||
@ -390,12 +390,12 @@ ngx_http_parse_expires(ngx_str_t *value, ngx_http_expires_t *expires,
|
|||||||
|
|
||||||
*expires = NGX_HTTP_EXPIRES_DAILY;
|
*expires = NGX_HTTP_EXPIRES_DAILY;
|
||||||
|
|
||||||
} else if (value->data[0] == '+') {
|
} else if (value->len && value->data[0] == '+') {
|
||||||
value->data++;
|
value->data++;
|
||||||
value->len--;
|
value->len--;
|
||||||
minus = 0;
|
minus = 0;
|
||||||
|
|
||||||
} else if (value->data[0] == '-') {
|
} else if (value->len && value->data[0] == '-') {
|
||||||
value->data++;
|
value->data++;
|
||||||
value->len--;
|
value->len--;
|
||||||
minus = 1;
|
minus = 1;
|
||||||
|
@ -553,7 +553,7 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
|
|||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.data[0] == '/') {
|
if (uri.len && uri.data[0] == '/') {
|
||||||
|
|
||||||
if (err_page->value.lengths) {
|
if (err_page->value.lengths) {
|
||||||
ngx_http_split_args(r, &uri, &args);
|
ngx_http_split_args(r, &uri, &args);
|
||||||
@ -570,7 +570,7 @@ ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
|
|||||||
return ngx_http_internal_redirect(r, &uri, &args);
|
return ngx_http_internal_redirect(r, &uri, &args);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.data[0] == '@') {
|
if (uri.len && uri.data[0] == '@') {
|
||||||
return ngx_http_named_location(r, &uri);
|
return ngx_http_named_location(r, &uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user