# HG changeset patch # User Daniel Atallah # Date 1220915055 0 # Node ID 67cb8706a2f22a710c003dc7701209a2fad67b1a # Parent 8777560c1d9ff926462598fb7750417795e5cd23 Fix a NULL pointer deref in the NSS SSL implementation with certain self-signed certs. Fixes #7013 diff -r 8777560c1d9f -r 67cb8706a2f2 libpurple/plugins/ssl/ssl-nss.c --- a/libpurple/plugins/ssl/ssl-nss.c Mon Sep 08 01:29:00 2008 +0000 +++ b/libpurple/plugins/ssl/ssl-nss.c Mon Sep 08 23:04:15 2008 +0000 @@ -285,7 +285,8 @@ } 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 @@ 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;