diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp index fdde46d7578..2e028ceb342 100644 --- a/modules/libjar/nsJAR.cpp +++ b/modules/libjar/nsJAR.cpp @@ -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(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"); diff --git a/modules/libjar/nsJAR.h b/modules/libjar/nsJAR.h index b03b282c545..8725574a4e0 100644 --- a/modules/libjar/nsJAR.h +++ b/modules/libjar/nsJAR.h @@ -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); }; /**