зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1602277 - Limit the data length that the last ditch sniffer will consume. r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D61810 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
cffd63aba1
Коммит
af33711937
|
@ -636,7 +636,9 @@ bool nsUnknownDecoder::LastDitchSniff(nsIRequest* aRequest) {
|
|||
uint32_t testDataLen;
|
||||
if (mDecodedData.IsEmpty()) {
|
||||
testData = mBuffer;
|
||||
testDataLen = mBufferLen;
|
||||
// Since some legacy text files end with 0x1A, reading the entire buffer
|
||||
// will lead misdetection.
|
||||
testDataLen = std::min<uint32_t>(mBufferLen, MAX_BUFFER_SIZE);
|
||||
} else {
|
||||
testData = mDecodedData.get();
|
||||
testDataLen = std::min(mDecodedData.Length(), MAX_BUFFER_SIZE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче