Bug 892588 - crash in nsNSSASN1Sequence::~nsNSSASN1Sequence, r=bsmith

--HG--
extra : rebase_source : a3d1a29f0ebcfb05462be3a46b38b7be08163379
This commit is contained in:
Olli Pettay 2013-07-29 19:46:52 +03:00
parent 5396546754
commit 070b42da93
4 changed files with 15 additions and 20 deletions

View File

@ -20,7 +20,7 @@
class nsNSSASN1Sequence : public nsIASN1Sequence
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_ISUPPORTS
NS_DECL_NSIASN1SEQUENCE
NS_DECL_NSIASN1OBJECT
@ -40,7 +40,7 @@ private:
class nsNSSASN1PrintableItem : public nsIASN1PrintableItem
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_ISUPPORTS
NS_DECL_NSIASN1PRINTABLEITEM
NS_DECL_NSIASN1OBJECT

View File

@ -2110,7 +2110,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence **retSequence,
}
nsresult
nsNSSCertificate::CreateASN1Struct()
nsNSSCertificate::CreateASN1Struct(nsIASN1Object** aRetVal)
{
nsNSSShutDownPreventionLock locker;
if (isAlreadyShutDown())
@ -2118,14 +2118,14 @@ nsNSSCertificate::CreateASN1Struct()
nsCOMPtr<nsIASN1Sequence> sequence = new nsNSSASN1Sequence();
mASN1Structure = sequence;
nsCOMPtr<nsIMutableArray> asn1Objects;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
nsXPIDLCString title;
GetWindowTitle(getter_Copies(title));
mASN1Structure->SetDisplayName(NS_ConvertUTF8toUTF16(title));
sequence->SetDisplayName(NS_ConvertUTF8toUTF16(title));
*aRetVal = sequence.forget().get();
// This sequence will be contain the tbsCertificate, signatureAlgorithm,
// and signatureValue.
nsresult rv;

View File

@ -1372,19 +1372,15 @@ nsNSSCertificate::GetASN1Structure(nsIASN1Object * *aASN1Structure)
nsNSSShutDownPreventionLock locker;
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(aASN1Structure);
if (!mASN1Structure) {
// First create the recursive structure os ASN1Objects
// which tells us the layout of the cert.
rv = CreateASN1Struct();
if (NS_FAILED(rv)) {
return rv;
}
#ifdef DEBUG_javi
DumpASN1Object(mASN1Structure, 0);
#endif
// First create the recursive structure os ASN1Objects
// which tells us the layout of the cert.
rv = CreateASN1Struct(aASN1Structure);
if (NS_FAILED(rv)) {
return rv;
}
*aASN1Structure = mASN1Structure;
NS_IF_ADDREF(*aASN1Structure);
#ifdef DEBUG_javi
DumpASN1Object(*aASN1Structure, 0);
#endif
return rv;
}

View File

@ -60,8 +60,7 @@ private:
mozilla::ScopedCERTCertificate mCert;
bool mPermDelete;
uint32_t mCertType;
nsCOMPtr<nsIASN1Object> mASN1Structure;
nsresult CreateASN1Struct();
nsresult CreateASN1Struct(nsIASN1Object** aRetVal);
nsresult CreateTBSCertificateASN1Struct(nsIASN1Sequence **retSequence,
nsINSSComponent *nssComponent);
nsresult GetSortableDate(PRTime aTime, nsAString &_aSortableDate);