(nameLen = cndomain - cn) < sizeof cnbuf  && nameLen > 0) {
(cndomain - cn) > 0) {
cert_TestHostName(const char * cn, const char * hn){    char * hndomain;    int    regvalid;    char   cnbuf[80];    if ((hndomain = PORT_Strchr(hn, '.')) == NULL) {	/* No domain in URI host name */	char * cndomain;	long   nameLen;	if ((cndomain = PORT_Strchr(cn, '.')) != NULL &&	    (nameLen = cndomain - cn) < sizeof cnbuf  &&	    nameLen > 0) {	    /* there is a domain in the cn string, so chop it off */	    memcpy(cnbuf, cn, nameLen);	    cnbuf[nameLen] = '\0';	    cn = (const char *)cnbuf;	}    }    regvalid = PORT_RegExpValid(cn);    if (regvalid != NON_SXP) {	SECStatus rv;	/* cn is a regular expression, try to match the shexp */	int match = PORT_RegExpCaseSearch(hn, cn);	if ( match == 0 ) {	    rv = SECSuccess;	} else {	    PORT_SetError(SSL_ERROR_BAD_CERT_DOMAIN);	    rv = SECFailure;	}	return rv;    }     /* cn is not a regular expression */    /* compare entire hn with cert name */    if (PORT_Strcasecmp(hn, cn) == 0) {	return SECSuccess;    }	        if ( hndomain ) {	/* compare just domain name with cert name */	if ( PORT_Strcasecmp(hndomain+1, cn) == 0 ) {	    return SECSuccess;	}    }    PORT_SetError(SSL_ERROR_BAD_CERT_DOMAIN);    return SECFailure;}