PORT_Memcpy(dbentry->data, &buf[SEC_DB_ENTRY_HEADER_LEN], dbentry->len);
ReadDBEntry(NSSLOWCERTCertDBHandle *handle, certDBEntryCommon *entry,	    SECItem *dbkey, SECItem *dbentry, PRArenaPool *arena){    DBT data, key;    int ret;    unsigned char *buf;        /* init the database key */    key.data = dbkey->data;    key.size = dbkey->len;        dbkey->data[0] = (unsigned char)entry->type;    /* read entry from database */    ret = certdb_Get(handle->permCertDB, &key, &data, 0 );    if ( ret != 0 ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	goto loser;    }        /* validate the entry */    if ( data.size < SEC_DB_ENTRY_HEADER_LEN ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	goto loser;    }    buf = (unsigned char *)data.data;    if ( buf[0] != (unsigned char)CERT_DB_FILE_VERSION ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	goto loser;    }    if ( buf[1] != (unsigned char)entry->type ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	goto loser;    }    /* copy out header information */    entry->version = (unsigned int)buf[0];    entry->type = (certDBEntryType)buf[1];    entry->flags = (unsigned int)buf[2];        /* format body of entry for return to caller */    dbentry->len = data.size - SEC_DB_ENTRY_HEADER_LEN;    if ( dbentry->len ) {	dbentry->data = (unsigned char *)PORT_ArenaAlloc(arena, dbentry->len);	if ( dbentry->data == NULL ) {	    PORT_SetError(SEC_ERROR_NO_MEMORY);	    goto loser;	}    	PORT_Memcpy(dbentry->data, &buf[SEC_DB_ENTRY_HEADER_LEN],		  dbentry->len);    } else {	dbentry->data = NULL;    }        return(SECSuccess);loser:    return(SECFailure);}