Wireshark-dev: Re: [Wireshark-dev] [Wireshark-bugs] [Bug 7976] Lua code crashes wireshark after

From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Fri, 07 Dec 2012 16:57:07 -0500
Joerg Mayer wrote:
On Tue, Dec 04, 2012 at 10:39:16PM +0000, bugzilla-daemon@xxxxxxxxxxxxx wrote:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7976

Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|INCOMPLETE                  |RESOLVED
         Resolution|---                         |FIXED

--- Comment #17 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> ---
The original fix did not check the condition in all cases.  r46302 (trunk) and
r46303 (trunk-1.8).  So it should be fixed in 1.8.5.  If you want to try it out
before then you can get an automated build from:

http://www.wireshark.org/download/automated/

I'm guessing this will be the complete fix, so closing again.

Just as an idea for an alternate solution: Create a constant string at the
top of the file, saying something like
"It is an error to leave the abbreviation field empty" and thenx, whenever
we encounter this error instead of calling WSLUA_ARG_ERROR or luaL_argerror
just do a g_strdup of that string into abbr?

If we could also pop up an error the first time we have to do that (so that the dissector author is aware of the bug) that might not be a bad idea.

(I just checked and "Prepare as Filter" doesn't crash--at least on Linux--when the abbreviation for the field in question is an empty string. So while a field without an abbreviation is at least half useless, it doesn't appear to be a threat.)