Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Thomas Wiens
On 21.10.2016 22:49, Michael Mann wrote: > > Depending on what you're doing, you could go with > proto_tree_add_xxx_format_value. I think that's how most dissectors > end up avoiding the need for BASE_CUSTOM callback. Maybe one of you has another solution for what I want to realize. In my prot

Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Michael Mann
16 4:45 pm Subject: Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function On 21.10.2016 22:17, Guy Harris wrote: > On Oct 21, 2016, at 1:08 PM, Jaap Keuter wrote: > >> For my understanding, would this be covered by using >> val_to_str_wmem(wme

Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Thomas Wiens
On 21.10.2016 22:17, Guy Harris wrote: > On Oct 21, 2016, at 1:08 PM, Jaap Keuter wrote: > >> For my understanding, would this be covered by using >> val_to_str_wmem(wmem_file_scope(), val, vs, fmt); > > Yes, but the strings will remain allocated until the capture file is closed, > even if that

Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Guy Harris
On Oct 21, 2016, at 1:08 PM, Jaap Keuter wrote: > For my understanding, would this be covered by using > val_to_str_wmem(wmem_file_scope(), val, vs, fmt); Yes, but the strings will remain allocated until the capture file is closed, even if that's not necessary. _

Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Jaap Keuter
On 21-10-16 19:47, Guy Harris wrote: > On Oct 21, 2016, at 9:57 AM, Thomas Wiens wrote: > >> This happens only when calling val_to_str inside the callback function. >> When outside, then all is Ok (getting formatted result string on failure). >> When I'm calling try_val_to_str_idx with a non exis

Re: [Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Guy Harris
On Oct 21, 2016, at 9:57 AM, Thomas Wiens wrote: > This happens only when calling val_to_str inside the callback function. > When outside, then all is Ok (getting formatted result string on failure). > When I'm calling try_val_to_str_idx with a non existing value, then I > get -1 as index and NUL

[Wireshark-dev] Problem with val_to_str inside BASE_CUSTOM callback function

2016-10-21 Thread Thomas Wiens
Hi, I'am using fieldtype BASE_CUSTOM and a callback function in my own dissector. Works well, but when I am calling val_to_str with a value which is not inside the value_string list, then wireshark crashes. This happens only when calling val_to_str inside the callback function. When outside, then