Wireshark-dev: Re: [Wireshark-dev] emem.c:732: failed assertion [sort-of-SOLVED]

From: didier <dgautheron@xxxxxxxx>
Date: Mon, 01 Mar 2010 19:20:25 +0100
Hi,
Le lundi 01 mars 2010 ᅵ 16:48 +0100, varname a ᅵcrit :
> Luis EG Ontanon wrote:
> >> Don't know if it's the only way, but changing the limit to 10MB fixed it
> >> for my situation.
> > 
> > It might have worked it arround until an 11Mb request overflows it again.
> 
> sure. That's why I wrote "for my situation". I 'never' expect to have to 
> allocate more than 10MB at a time, but that was probably the reasoning 
> of the developer that implemented the check in the first place.
> 
> 
> > What it should be done IMHO is to g_malloc()ate the block directly if
> > it happens to be bigger than the limit instead of failing. (and of
> > course that would need to be freed as the ep-memory gets renewed).
In this particular case, lua glue shouldn't use ep memory

wslua_field.c

ByteArray ba = g_byte_array_new();
g_byte_array_append(ba,ep_tvb_memdup(fi->ds_tvb,fi->start,fi->length),fi->length);

IMO tvb_get_ptr is fine here, data is copied in g_byte_array_append.

Didier