Bug 1841242 - ObliviousHttpChannel::OnDataAvailable should accept multiple calls r=necko-reviewers,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D182555
This commit is contained in:
Valentin Gosu 2023-06-30 11:14:08 +00:00
Родитель 7afdf92429
Коммит f139147694
1 изменённых файлов: 1 добавлений и 3 удалений

Просмотреть файл

@ -659,9 +659,7 @@ ObliviousHttpChannel::OnDataAvailable(nsIRequest* aRequest,
("ObliviousHttpChannel::OnDataAvailable [this=%p, request=%p, stream=%p, "
"offset=%" PRIu64 ", count=%u]",
this, aRequest, aStream, aOffset, aCount));
if (aOffset != 0) {
return NS_ERROR_INVALID_ARG;
}
MOZ_ASSERT(aOffset == mRawResponse.Length());
size_t oldLength = mRawResponse.Length();
size_t newLength = oldLength + aCount;
if (newLength < oldLength) { // i.e., overflow