mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -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;
|
||||
|
||||
len = line->len;
|
||||
|
||||
if (len == 0) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
unit = line->data[len - 1];
|
||||
|
||||
switch (unit) {
|
||||
@ -58,6 +63,11 @@ ngx_parse_offset(ngx_str_t *line)
|
||||
size_t len;
|
||||
|
||||
len = line->len;
|
||||
|
||||
if (len == 0) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
unit = line->data[len - 1];
|
||||
|
||||
switch (unit) {
|
||||
|
Loading…
Reference in New Issue
Block a user