pidgin: 3cbc7447: Fix a NULL pointer deref in the NSS SSL ...

datallah at pidgin.im datallah at pidgin.im
Mon Sep 8 19:10:34 EDT 2008


-----------------------------------------------------------------
Revision: 3cbc74478c8df61d53804d0363dc936a3e0adeb7
Ancestor: 254e5a24031a74103097db812ae3e723d696c11d
Author: datallah at pidgin.im
Date: 2008-09-08T23:04:15
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3cbc74478c8df61d53804d0363dc936a3e0adeb7

Modified files:
        libpurple/plugins/ssl/ssl-nss.c

ChangeLog: 

Fix a NULL pointer deref in the NSS SSL implementation with certain self-signed
certs.
Fixes #7013

-------------- next part --------------
============================================================
--- libpurple/plugins/ssl/ssl-nss.c	c6c576ba92370703e89850d8e6dc88b7fec3e523
+++ libpurple/plugins/ssl/ssl-nss.c	d6de7a59c8b1c42086fd8e7153865718fc3289e6
@@ -285,7 +285,8 @@ ssl_nss_get_peer_certificates(PRFileDesc
 	}
 	
 	for (count = 0 ; count < CERT_MAX_CERT_CHAIN ; count++) {
-		purple_debug_info("nss", "subject=%s issuer=%s\n", curcert->subjectName, curcert->issuerName);
+		purple_debug_info("nss", "subject=%s issuer=%s\n", curcert->subjectName,
+						  curcert->issuerName  ? curcert->issuerName : "(null)");
 		newcrt = x509_import_from_nss(curcert);
 		peer_certs = g_list_append(peer_certs, newcrt);
 
@@ -676,7 +677,8 @@ x509_signed_by(PurpleCertificate * crt,
 	subjectCert = X509_NSS_DATA(crt);
 	g_return_val_if_fail(subjectCert, FALSE);
 
-	if ( PORT_Strcmp(subjectCert->issuerName, issuerCert->subjectName) != 0 )
+	if (subjectCert->issuerName == NULL
+			|| PORT_Strcmp(subjectCert->issuerName, issuerCert->subjectName) != 0)
 		return FALSE;
 	st = CERT_VerifySignedData(&subjectCert->signatureWrap, issuerCert, PR_Now(), NULL);
 	return st == SECSuccess;


More information about the Commits mailing list