Wireshark mailing list archives
Re: Is there a need for a 0, NULL element at the end of value strings
From: Pascal Quantin <pascal.quantin () gmail com>
Date: Tue, 16 Oct 2018 17:30:25 +0200
Hi Richard, Le mar. 16 oct. 2018 à 17:26, Richard Sharpe <realrichardsharpe () gmail com> 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.
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: https://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Pascal Quantin (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Guy Harris (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Richard Sharpe (Oct 16)
- Re: Is there a need for a 0, NULL element at the end of value strings Guy Harris (Oct 16)