ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] Should we check value_strings for NULL termination while registe

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Wed, 20 Sep 2006 17:31:23 +0200
Hi List!

It seems to be a common mistake to forget the terminating zero entry in a value_string, I've done this myself before and it's hard to track it down if you don't have a clue what's going wrong.

Even worse, this mistake might not make any problems for a long time as usually the values rushing in will be in the value_string (I've found my mistake by fuzz-testing).

We could automatically check the termination of the value_string (at least for the registered values) while registering the hf_ values. This will indicate the problem a lot earlier and at the place where it's caused (and not much, much later).

Of cause this has a drawback: Iterating trough all value_strings at registration will take a little bit of time at startup (didn't tried so don't know how long this will take).

What do others think: Is the added time overhead worth adding some extra robustness or are there other mechanisms possible to detect these kind of errors (e.g. static code analysis)?

Regards, ULFL
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066