mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1167888
- better string length check in nsZipArchive::BuildFileList, r=smaug
This commit is contained in:
parent
11447ad068
commit
006c22233c
@ -644,8 +644,13 @@ MOZ_WIN_MEM_TRY_BEGIN
|
||||
if (!centralOffset)
|
||||
return NS_ERROR_FILE_CORRUPTED;
|
||||
|
||||
//-- Read the central directory headers
|
||||
buf = startp + centralOffset;
|
||||
|
||||
// avoid overflow of startp + centralOffset.
|
||||
if (buf < startp)
|
||||
return NS_ERROR_FILE_CORRUPTED;
|
||||
|
||||
//-- Read the central directory headers
|
||||
uint32_t sig = 0;
|
||||
while (buf + int32_t(sizeof(uint32_t)) <= endp &&
|
||||
(sig = xtolong(buf)) == CENTRALSIG) {
|
||||
|
Loading…
Reference in New Issue
Block a user