Commit 860c7469 authored by nelsonb%netscape.com's avatar nelsonb%netscape.com
Browse files

Check some pointers for NULL before dereferencing them.

parent e6168486
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
 */

#ifdef DEBUG
static const char CVS_ID[] = "@(#) $RCSfile: devobject.c,v $ $Revision: 1.5 $ $Date: 2001/12/11 20:28:33 $ $Name:  $";
static const char CVS_ID[] = "@(#) $RCSfile: devobject.c,v $ $Revision: 1.6 $ $Date: 2001/12/11 23:47:18 $ $Name:  $";
#endif /* DEBUG */

#ifndef DEV_H
@@ -374,8 +374,11 @@ get_token_cert
	nssDecodedCert *dc;
	NSSASCII7 *email;
	dc = nssCertificate_GetDecoding(rvCert);
	if (dc) {
	    email = dc->getEmailAddress(dc);
	if (email) rvCert->email = nssUTF8_Duplicate(email, arena);
	    if (email) 
	    	rvCert->email = nssUTF8_Duplicate(email, arena);
	}
    }
#endif
    return rvCert;
+8 −6
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
 */

#ifdef DEBUG
static const char CVS_ID[] = "@(#) $RCSfile: pki3hack.c,v $ $Revision: 1.9 $ $Date: 2001/12/11 20:28:37 $ $Name:  $";
static const char CVS_ID[] = "@(#) $RCSfile: pki3hack.c,v $ $Revision: 1.10 $ $Date: 2001/12/11 23:47:16 $ $Name:  $";
#endif /* DEBUG */

/*
@@ -298,7 +298,7 @@ static NSSASCII7 *
nss3certificate_getEmailAddress(nssDecodedCert *dc)
{
    CERTCertificate *cc = (CERTCertificate *)dc->data;
    return (NSSASCII7 *)cc->emailAddr;
    return cc ? (NSSASCII7 *)cc->emailAddr : NULL;
}

NSS_IMPLEMENT nssDecodedCert *
@@ -490,11 +490,13 @@ STAN_GetCERTCertificate(NSSCertificate *c)
	dc = c->decoding;
    }
    cc = (CERTCertificate *)dc->data;
    if (cc) {
	if (!cc->nssCertificate) {
	    fill_CERTCertificateFields(c, cc);
	} else if (!cc->trust) {
	    cc->trust = nssTrust_GetCERTCertTrustForCert(c, cc);
	}
    }
    return cc;
}