range: checks that end is after start

Otherwise, we end up allocating too much memory
pull/6478/head
Philippe Antoine 4 years ago committed by Victor Julien
parent 27b4f165b1
commit bba70607e8

@ -196,6 +196,11 @@ static int HTPParseAndCheckContentRange(
} else if (range->end == range->size - 1 && range->start == 0) {
SCLogDebug("range without all information");
return -3;
} else if (range->start > range->end) {
AppLayerDecoderEventsSetEventRaw(&htud->decoder_events, HTTP_DECODER_EVENT_RANGE_INVALID);
s->events++;
SCLogDebug("invalid range");
return -4;
}
return r;
}

Loading…
Cancel
Save