mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 697061: better string handling in nsJAR.cpp. r=tglek
This commit is contained in:
parent
8c01a25338
commit
e58ffede12
@ -400,11 +400,10 @@ nsJAR::GetCertificatePrincipal(const nsACString &aFilename, nsIPrincipal** aPrin
|
||||
return NS_OK;
|
||||
|
||||
PRInt16 requestedStatus;
|
||||
const char *filename = PromiseFlatCString(aFilename).get();
|
||||
if (*filename)
|
||||
if (!aFilename.IsEmpty())
|
||||
{
|
||||
//-- Find the item
|
||||
nsCStringKey key(filename);
|
||||
nsCStringKey key(aFilename);
|
||||
nsJARManifestItem* manItem = static_cast<nsJARManifestItem*>(mManifestData.Get(&key));
|
||||
if (!manItem)
|
||||
return NS_OK;
|
||||
@ -424,7 +423,7 @@ nsJAR::GetCertificatePrincipal(const nsACString &aFilename, nsIPrincipal** aPrin
|
||||
requestedStatus = mGlobalStatus;
|
||||
|
||||
if (requestedStatus != JAR_VALID_MANIFEST)
|
||||
ReportError(filename, requestedStatus);
|
||||
ReportError(aFilename, requestedStatus);
|
||||
else // Valid signature
|
||||
{
|
||||
*aPrincipal = mPrincipal;
|
||||
@ -840,12 +839,12 @@ nsJAR::VerifyEntry(nsJARManifestItem* aManItem, const char* aEntryData,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsJAR::ReportError(const char* aFilename, PRInt16 errorCode)
|
||||
void nsJAR::ReportError(const nsACString &aFilename, PRInt16 errorCode)
|
||||
{
|
||||
//-- Generate error message
|
||||
nsAutoString message;
|
||||
message.AssignLiteral("Signature Verification Error: the signature on ");
|
||||
if (aFilename)
|
||||
if (!aFilename.IsEmpty())
|
||||
message.AppendWithConversion(aFilename);
|
||||
else
|
||||
message.AppendLiteral("this .jar archive");
|
||||
|
@ -146,7 +146,7 @@ class nsJAR : public nsIZipReader
|
||||
bool mOpened;
|
||||
|
||||
nsresult ParseManifest();
|
||||
void ReportError(const char* aFilename, PRInt16 errorCode);
|
||||
void ReportError(const nsACString &aFilename, PRInt16 errorCode);
|
||||
nsresult LoadEntry(const nsACString &aFilename, char** aBuf,
|
||||
PRUint32* aBufLen = nsnull);
|
||||
PRInt32 ReadLine(const char** src);
|
||||
@ -156,9 +156,6 @@ class nsJAR : public nsIZipReader
|
||||
|
||||
nsresult CalculateDigest(const char* aInBuf, PRUint32 aInBufLen,
|
||||
nsCString& digest);
|
||||
|
||||
//-- Debugging
|
||||
void DumpMetadata(const char* aMessage);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user