mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Use new Test() API in libjar to ensure archive integrity before installing.
b = 61544 r = dveditz sr = dveditz
This commit is contained in:
parent
6d76941848
commit
0144ba99dc
@ -184,6 +184,14 @@ GetInstallScriptFromJarfile(nsIZipReader* hZip, nsIFile* jarFile, char** scriptB
|
||||
if (NS_FAILED(rv))
|
||||
return nsInstall::CANT_READ_ARCHIVE;
|
||||
|
||||
// CRC check the integrity of all items in this archive
|
||||
rv = hZip->Test(nsnull);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
NS_ASSERTION(0, "CRC check of archive failed!");
|
||||
return nsInstall::CANT_READ_ARCHIVE;
|
||||
}
|
||||
|
||||
// Extract the install.js file to the temporary directory
|
||||
nsSpecialSystemDirectory installJSFileSpec(nsSpecialSystemDirectory::OS_TemporaryDirectory);
|
||||
installJSFileSpec += "install.js";
|
||||
|
Loading…
Reference in New Issue
Block a user