} else { goto loser;
CERT_CompareNameSpace(CERTCertificate  *cert,		      CERTGeneralName  *namesList, 		      SECItem          *namesListIndex, 		      PRArenaPool      *arena, 		      CERTCertDBHandle *handle){    SECStatus            rv;    SECItem              constraintsExtension;    CERTNameConstraints  *constraints;    CERTGeneralName      *currentName;    int                  count = 0;    CERTNameConstraint  *matchingConstraints;    CERTCertificate      *badCert = NULL;        rv = CERT_FindCertExtension(cert, SEC_OID_X509_NAME_CONSTRAINTS,                                 &constraintsExtension);    if (rv != SECSuccess) 	return NULL;    constraints = cert_DecodeNameConstraints(arena, &constraintsExtension);    currentName = namesList;    if (constraints == NULL)  /* decode failed */	goto loser;    do { 	if (constraints->excluded != NULL) { 	    rv = CERT_GetNameConstraintByType(constraints->excluded, 	                                      currentName->type,  					      &matchingConstraints, arena); 	    if (rv != SECSuccess) 		goto loser; 	    if (matchingConstraints != NULL) { 		rv = cert_CompareNameWithConstraints(currentName, 		                                     matchingConstraints, 						     PR_TRUE); 		if (rv != SECSuccess)  		    goto loser; 	    } 	} 	if (constraints->permited != NULL) { 	    rv = CERT_GetNameConstraintByType(constraints->permited, 	                                      currentName->type,  					      &matchingConstraints, arena);            if (rv != SECSuccess) 		goto loser; 	    if (matchingConstraints != NULL) { 		rv = cert_CompareNameWithConstraints(currentName, 		                                     matchingConstraints, 						     PR_FALSE); 		if (rv != SECSuccess)  		    goto loser; 	    } else { 		goto loser; /* name type not among permitted types */ 	    } 	} 	currentName = cert_get_next_general_name(currentName); 	count ++;    } while (currentName != namesList);    return NULL;loser:    badCert = CERT_FindCertByName (handle, &namesListIndex[count]);    return badCert;}