http: fix overflow in HTPParseContentRange

pull/3935/head
Philippe Antoine 6 years ago committed by Victor Julien
parent c1b30fe9fd
commit 90ab0b0ec2

@ -196,13 +196,13 @@ int HTPParseContentRange(bstr * rawvalue, HtpContentRange *range)
// case with start and end
range->start = bstr_util_mem_to_pint(data + pos, len - pos, 10, &last_pos);
pos += last_pos;
if (len < pos || data[pos] != '-') {
if (len < pos + 1 || data[pos] != '-') {
return -1;
}
pos++;
range->end = bstr_util_mem_to_pint(data + pos, len - pos, 10, &last_pos);
pos += last_pos;
if (len < pos || data[pos] != '/') {
if (len < pos + 1 || data[pos] != '/') {
return -1;
}
pos++;

Loading…
Cancel
Save