Wireshark-dev: Re: [Wireshark-dev] Should we check value_strings for NULL termination while reg
From: Jeff Morriss <jeff.morriss@xxxxxxxxxxx>
Date: Fri, 22 Sep 2006 11:08:20 +0800


Ulf Lamping wrote:
Gilbert Ramirez wrote:
I believe we do this in the build-bot testing, by doing:

tshark -G values

Since that operation iterates across all the value_string arrays, a
non-terminated array will result in an error .... or at least it
should.

Is that enough testing?
Unsure. It can drive you mad if you develop a dissector and crash for that reason as there's no hint into that direction. It can take you hours of development time to find the cause.

So it's basically a tradeoff between ease of development (crash if the value_string isn't zero terminated) and program startup time (as this check obviously will require some time to be done).

The build-bot tests are (hopefully) done long after the dissector is developed and seems to work perfectly. So yes, it helps to make sure no security related bugs are introduced but no, it won't help much during development time of an (unexperienced) developer.

Sounds like a good use for a build option. Make it default to on for those of us who just do "./autogen.sh && ./configure && make" but have the official builds turn it off.

Only problem with that is those of us who roll our own packages need to remember to turn it off when doing our "official" (deployment) builds.