for (j=0; j<obj->numAttributes; j++) { if (ot[i].type == obj->attributes[j].type) { if (ot[i].ulValueLen == obj->attributes[j].ulValueLen && nsslibc_memequal(ot[i].pValue, obj->attributes[j].pValue, ot[i].ulValueLen, NULL)) { match = PR_TRUE; } else { match = PR_FALSE; } break; }
attr = find_attribute_in_object(obj, ot[i].type); if (!attr) {  break;
find_objects_in_array(  nssCryptokiObjectAndAttributes **objArray,  CK_ATTRIBUTE_PTR ot,  CK_ULONG otlen,  PRUint32 maximumOpt){    PRIntn oi = 0;    PRUint32 i, j;    PRBool match;    NSSArena *arena;    PRUint32 size = 8;    PRUint32 numMatches = 0;    nssCryptokiObject **objects = NULL;    nssCryptokiObjectAndAttributes **matches = NULL;    if (!objArray) {	return (nssCryptokiObject **)NULL;    }    arena = nssArena_Create();    if (!arena) {	return (nssCryptokiObject **)NULL;    }    matches = nss_ZNEWARRAY(arena, nssCryptokiObjectAndAttributes *, size);    if (!matches) {	goto loser;    }    if (maximumOpt == 0) maximumOpt = ~0;    for (; *objArray && numMatches < maximumOpt; objArray++) {	nssCryptokiObjectAndAttributes *obj = *objArray;	match = PR_FALSE;	for (i=0; i<otlen; i++) {	    for (j=0; j<obj->numAttributes; j++) {		if (ot[i].type == obj->attributes[j].type) {		    if (ot[i].ulValueLen == obj->attributes[j].ulValueLen &&		        nsslibc_memequal(ot[i].pValue, 			                 obj->attributes[j].pValue,			                 ot[i].ulValueLen, NULL))		    {			match = PR_TRUE;		    } else {			match = PR_FALSE;		    }		    break;		}	    }	    if (j == obj->numAttributes || !match) {		break;	    }	}	if (match) {	    matches[numMatches++] = obj;	    if (numMatches == size) {		size *= 2;		matches = nss_ZREALLOCARRAY(matches, 		                            nssCryptokiObjectAndAttributes *, 		                            size);		if (!matches) {		    goto loser;		}	    }	}    }    if (numMatches > 0) {	objects = nss_ZNEWARRAY(NULL, nssCryptokiObject *, numMatches + 1);	if (!objects) {	    goto loser;	}	for (oi=0; oi<(PRIntn)numMatches; oi++) {	    objects[oi] = nssCryptokiObject_Clone(matches[oi]->object);	    if (!objects[oi]) {		goto loser;	    }	}    }    nssArena_Destroy(arena);    return objects;loser:    if (objects) {	for (--oi; oi>=0; --oi) {	    nssCryptokiObject_Destroy(objects[oi]);	}    }    nssArena_Destroy(arena);    return (nssCryptokiObject **)NULL;}