mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Bug 1182599 - Check for corrupted delta array in UrlClassifier. r=francois
This commit is contained in:
parent
0a2f73b72e
commit
6ffc4e3652
@ -322,6 +322,9 @@ nsUrlClassifierPrefixSet::LoadFromFd(AutoFDClose& fileFd)
|
|||||||
for (uint32_t i = 0; i < indexSize; i++) {
|
for (uint32_t i = 0; i < indexSize; i++) {
|
||||||
uint32_t numInDelta = i == indexSize - 1 ? deltaSize - indexStarts[i]
|
uint32_t numInDelta = i == indexSize - 1 ? deltaSize - indexStarts[i]
|
||||||
: indexStarts[i + 1] - indexStarts[i];
|
: indexStarts[i + 1] - indexStarts[i];
|
||||||
|
if (numInDelta > DELTAS_LIMIT) {
|
||||||
|
return NS_ERROR_FILE_CORRUPTED;
|
||||||
|
}
|
||||||
if (numInDelta > 0) {
|
if (numInDelta > 0) {
|
||||||
mIndexDeltas[i].SetLength(numInDelta);
|
mIndexDeltas[i].SetLength(numInDelta);
|
||||||
mTotalPrefixes += numInDelta;
|
mTotalPrefixes += numInDelta;
|
||||||
|
Loading…
Reference in New Issue
Block a user