Ethereal-dev: RE: [Ethereal-dev] Patch epan/proto.c - proto_tree_append_string( )

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

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: Mon, 27 Oct 2003 20:49:39 -0000
On Mon, 2003-10-27 at 09:30, Biot Olivier wrote:
> Oops - I sent an incorrect patch. This one is OK.
> 
> However it's still unclear to me why an fvalue_free() call before the new
> fvalue_set() call yields a core dump.
> 
> Regards,
> 
> Olivier


+       fvalue_free(fi->value);
+       fvalue_set(fi->value, new_str, TRUE);


Were you getting a core dump on the fvalue_free() or the fvalue_set()?

Note the fvalue_free() frees the memory used by the fvalue_t structure,
so the fvalue_set() immediately after fvalue_free() is writing to
deallocated memory.

--gilbert