mirror of
https://github.com/nginx/nginx.git
synced 2024-12-22 07:03:27 -06:00
Fixed ngx_parse_size() / ngx_parse_offset() with 0-length strings.
This commit is contained in:
parent
ff16c6f99c
commit
6183ca9ea8
@ -17,6 +17,11 @@ ngx_parse_size(ngx_str_t *line)
|
|||||||
ssize_t size, scale, max;
|
ssize_t size, scale, max;
|
||||||
|
|
||||||
len = line->len;
|
len = line->len;
|
||||||
|
|
||||||
|
if (len == 0) {
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
unit = line->data[len - 1];
|
unit = line->data[len - 1];
|
||||||
|
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
@ -58,6 +63,11 @@ ngx_parse_offset(ngx_str_t *line)
|
|||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = line->len;
|
len = line->len;
|
||||||
|
|
||||||
|
if (len == 0) {
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
unit = line->data[len - 1];
|
unit = line->data[len - 1];
|
||||||
|
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user