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;
|
return NS_OK;
|
||||||
|
|
||||||
PRInt16 requestedStatus;
|
PRInt16 requestedStatus;
|
||||||
const char *filename = PromiseFlatCString(aFilename).get();
|
if (!aFilename.IsEmpty())
|
||||||
if (*filename)
|
|
||||||
{
|
{
|
||||||
//-- Find the item
|
//-- Find the item
|
||||||
nsCStringKey key(filename);
|
nsCStringKey key(aFilename);
|
||||||
nsJARManifestItem* manItem = static_cast<nsJARManifestItem*>(mManifestData.Get(&key));
|
nsJARManifestItem* manItem = static_cast<nsJARManifestItem*>(mManifestData.Get(&key));
|
||||||
if (!manItem)
|
if (!manItem)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -424,7 +423,7 @@ nsJAR::GetCertificatePrincipal(const nsACString &aFilename, nsIPrincipal** aPrin
|
|||||||
requestedStatus = mGlobalStatus;
|
requestedStatus = mGlobalStatus;
|
||||||
|
|
||||||
if (requestedStatus != JAR_VALID_MANIFEST)
|
if (requestedStatus != JAR_VALID_MANIFEST)
|
||||||
ReportError(filename, requestedStatus);
|
ReportError(aFilename, requestedStatus);
|
||||||
else // Valid signature
|
else // Valid signature
|
||||||
{
|
{
|
||||||
*aPrincipal = mPrincipal;
|
*aPrincipal = mPrincipal;
|
||||||
@ -840,12 +839,12 @@ nsJAR::VerifyEntry(nsJARManifestItem* aManItem, const char* aEntryData,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsJAR::ReportError(const char* aFilename, PRInt16 errorCode)
|
void nsJAR::ReportError(const nsACString &aFilename, PRInt16 errorCode)
|
||||||
{
|
{
|
||||||
//-- Generate error message
|
//-- Generate error message
|
||||||
nsAutoString message;
|
nsAutoString message;
|
||||||
message.AssignLiteral("Signature Verification Error: the signature on ");
|
message.AssignLiteral("Signature Verification Error: the signature on ");
|
||||||
if (aFilename)
|
if (!aFilename.IsEmpty())
|
||||||
message.AppendWithConversion(aFilename);
|
message.AppendWithConversion(aFilename);
|
||||||
else
|
else
|
||||||
message.AppendLiteral("this .jar archive");
|
message.AppendLiteral("this .jar archive");
|
||||||
|
@ -146,7 +146,7 @@ class nsJAR : public nsIZipReader
|
|||||||
bool mOpened;
|
bool mOpened;
|
||||||
|
|
||||||
nsresult ParseManifest();
|
nsresult ParseManifest();
|
||||||
void ReportError(const char* aFilename, PRInt16 errorCode);
|
void ReportError(const nsACString &aFilename, PRInt16 errorCode);
|
||||||
nsresult LoadEntry(const nsACString &aFilename, char** aBuf,
|
nsresult LoadEntry(const nsACString &aFilename, char** aBuf,
|
||||||
PRUint32* aBufLen = nsnull);
|
PRUint32* aBufLen = nsnull);
|
||||||
PRInt32 ReadLine(const char** src);
|
PRInt32 ReadLine(const char** src);
|
||||||
@ -156,9 +156,6 @@ class nsJAR : public nsIZipReader
|
|||||||
|
|
||||||
nsresult CalculateDigest(const char* aInBuf, PRUint32 aInBufLen,
|
nsresult CalculateDigest(const char* aInBuf, PRUint32 aInBufLen,
|
||||||
nsCString& digest);
|
nsCString& digest);
|
||||||
|
|
||||||
//-- Debugging
|
|
||||||
void DumpMetadata(const char* aMessage);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user