Bug 1270836 - prevent null pointer dereference on |data|. r?emaldona draft
authorAndi-Bogdan Postelnicu <bogdan.postelnicu@softvision.ro>
Tue, 10 May 2016 09:47:28 +0300
changeset 365182 55e09213b6122e85ddcfb723a8c5a4a9463302ab
parent 364815 043082cb7bd8490c60815f67fbd1f33323ad7663
child 520475 8a07845dee73e28071ec18d3d396ce05ed6e0385
push id17657
push userBogdan.Postelnicu@softvision.ro
push dateTue, 10 May 2016 06:47:54 +0000
reviewersemaldona
bugs1270836
milestone49.0a1
Bug 1270836 - prevent null pointer dereference on |data|. r?emaldona MozReview-Commit-ID: 45LFxknL9Jy
security/nss/lib/ssl/sslcert.c
--- a/security/nss/lib/ssl/sslcert.c
+++ b/security/nss/lib/ssl/sslcert.c
@@ -446,17 +446,18 @@ ssl_ConfigCertByUsage(sslSocket *ss, CER
     }
 
     /* Check that we successfully picked an authType */
     if (arg.authType == ssl_auth_null) {
         PORT_SetError(SEC_ERROR_INVALID_ARGS);
         return SECFailure;
     }
     /* |data->authType| has to either agree or be ssl_auth_null. */
-    if (data->authType != ssl_auth_null && data->authType != arg.authType) {
+    if (data && data->authType != ssl_auth_null &&
+        data->authType != arg.authType) {
         PORT_SetError(SEC_ERROR_INVALID_ARGS);
         return SECFailure;
     }
     return ssl_ConfigCert(ss, cert, keyPair, &arg);
 }
 
 /* This function adopts pubKey and destroys it if things go wrong. */
 static ssl3KeyPair *