Wireshark mailing list archives

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


From: Luis EG Ontanon <luis () ontanon org>
Date: Mon, 1 Mar 2010 21:02:16 +0100

Yup, you're right, I did not consider the limit when I decided to use ep_alloc.

Anyway getting the limit out from emem works too.


BTW...
In the patch... I just forgot to free the blocks :(

--- emem.c.1    2010-03-01 20:59:15.000000000 +0100
+++ emem.c      2010-03-01 20:59:25.000000000 +0100
@@ -1066,7 +1066,9 @@
        }

        while (mem->large_blocks->len) {
+               void* ptr = g_ptr_array_index(mem->large_blocks,
mem->large_blocks->len - 1 );
                g_ptr_array_remove_index_fast(mem->large_blocks,
mem->large_blocks->len - 1 );
+               g_free(ptr);
        }
        
        /* clear them all out */



On Mon, Mar 1, 2010 at 7:20 PM, didier <dgautheron () magic fr> wrote:
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


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe




-- 
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: