Ethereal-dev: Re: Re: [Ethereal-dev] Re: ethereal bug

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Tue, 25 Feb 2003 8:55:29 +0100
Brad Hards wrote:
> Except, that both of them produce:
> GLib-CRITICAL **: file ghash.c: line 138 (g_hash_table_lookup): assertion `hash_table != NULL' failed.
> 


The problem seems to be that ncp_req_eid_hash is NULL.
I added some g_warning printouts in  ncp_eid_hash_lookup
and ncp_hash_lookup (packet-ncp2222.inc)

When I opened the file I got the following output:

ncp_req_eip_hash_lookup  ncp_req_eid_hash=0224D098
ncp_req_eip_hash_lookup  ncp_req_eid_hash=0224D098
ncp_req_eip_hash_lookup  ncp_req_eid_hash=00000000

One thing to avoid the GTK-Critical printout is to add check if the pointer is null, and then return NULL. However I'm not sure if that
is the best solution. 

=================================

ncp_req_hash_value*
ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence)
{
	ncp_req_hash_key		request_key;

      /* g_warning("ncp_hash_lookup  ncp_req_hash=%p ",ncp_req_hash); */

      if(!ncp_req_hash)    /* Fix for GTK-Critical */
        return NULL;
      
	request_key.conversation = conversation;
	request_key.nw_sequence = nw_sequence;

	return g_hash_table_lookup(ncp_req_hash, &request_key);
}

/* Returns the value_rec* for needed EID, or NULL if not found. */
ncp_req_eid_hash_value*
ncp_eid_hash_lookup(conversation_t *conversation _U_, guint32 nw_eid)
{
	ncp_req_eid_hash_key		request_eid_key;

      /* g_warning("ncp_req_eip_hash_lookup  ncp_req_eid_hash=%p ",ncp_req_hash); */

      if(!ncp_req_eid_hash) /* Fix for GTK-Critical */
        return NULL;

	request_eid_key.nw_eid = nw_eid;

	return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key);
}