Bug 541828: crash in BuildFileList (r=tglek)

This commit is contained in:
Alfred Kayser 2010-01-25 10:21:49 +01:00
parent 083f8dfa3d
commit b1dfdbc219

View File

@ -538,6 +538,8 @@ nsresult nsZipArchive::BuildFileList()
//-- Read the central directory headers //-- Read the central directory headers
buf = startp + centralOffset; buf = startp + centralOffset;
if (endp - buf < sizeof(PRUint32))
return NS_ERROR_FILE_CORRUPTED;
PRUint32 sig = xtolong(buf); PRUint32 sig = xtolong(buf);
while (sig == CENTRALSIG) { while (sig == CENTRALSIG) {
// Make sure there is enough data available. // Make sure there is enough data available.