Ethereal-dev: Re: [Ethereal-dev] Consistency checks for hf_ elements

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gerald Combs <gerald@xxxxxxxxxxxx>
Date: Mon, 29 Aug 2005 10:26:18 -0500
Ulf Lamping wrote:
> Joerg Mayer wrote:
> 
>> One thing I've wanted to write for a while: The attached script
>> checkhf.pl
>> tries to find out which hf_ variables are used inside a dissector but
>> never
>> added to the hf_register_info array. It's far from perfect (lots of false
>> alarms) but some of the finds are real.  Put the script into the
>> dissectors
>> directory and run "./checkhf.pl packet-*.c | grep ^NO" to find possibly
>> missing entries. Without the grep it will also report potentially
>> unused array entries as well. You may give only one filename as well
>> of course
>> (e.g. packet-afs.c).  Should this script be put into the tools/
>> directory?
>>
>>  
>>
> Why not?
> 
> But please add the comments you've provided above into the script. This
> way no one has to search for this mail to get the limitations.
> 
> In the past I've found some of the problems caused by these kind of
> bugs, so it's probably a good idea to automatically check for it.

Should we add checks for other things, such as improperly terminated
value_strings or occurences of sprintf/strcat/g_malloc/etc?