Files
Sylvestre Ledru 2fafa1ee1d Bug 2071196 - Avoid 32-bit overflow when converting chunk indices to file offsets in CacheFile (Coverity CID 1286534) r=necko-reviewers,valentin
kChunkSize is an int32_t and the chunk index is a uint32_t, so
`aIndex * kChunkSize` is evaluated in 32 bits and wraps once the index reaches
16384, i.e. for entries larger than 4GB. Both results feed int64_t offsets.
CacheFile::BytesFromChunk already casts before multiplying; do the same at the
two remaining sites.

Differential Revision: https://phabricator.services.mozilla.com/D325296
2026-09-11 09:23:40 +00:00
..