Wireshark-dev: Re: [Wireshark-dev] Is there a need for a 0, NULL element at the end of value st
From: Pascal Quantin <[email protected]>
Date: Tue, 16 Oct 2018 17:30:25 +0200
Hi Richard,

Le mar. 16 oct. 2018 à 17:26, Richard Sharpe <[email protected]> a écrit :
Hi folks,

I have always put a {0, NULL} element on the end of value strings, but
it seems the lua code for constructing value strings when you use
ProtoField(..., some_value_string) does not terminate the list with an
empty element, and my test did not cause a crash.

Rather, I got an "unknown" field as expected.

Can anyone confirm they are not needed?

With C code, their presence is mandatory to properly end the loop in try_val_to_str_idx/try_val64_to_str_idx functions without doing an out of bounds access. I have no checked the Lua wrapper code.

BR,
Pascal.