Wireshark-bugs: [Wireshark-bugs] [Bug 5941] New: Wireshark crashes when calling TreeItem:set_len
Date: Sat, 21 May 2011 16:53:45 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5941

           Summary: Wireshark crashes when calling TreeItem:set_len() on
                    TreeItem without tvb
           Product: Wireshark
           Version: 1.4.6
          Platform: x86-64
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: Medium
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: tony19@xxxxxxxxx


Created an attachment (id=6374)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=6374)
Mac OS X crash report

Build Information:
2011-05-21 19:41:49.763 defaults[4522:903] 
The domain/default pair of (kCFPreferencesAnyApplication,
AppleAquaColorVariant) does not exist
2011-05-21 19:41:49.775 defaults[4523:903] 
The domain/default pair of (kCFPreferencesAnyApplication, AppleHighlightColor)
does not exist
wireshark 1.4.6 (SVN Rev 36706 from /trunk-1.4)

Copyright 1998-2011 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 2.20.1, with GLib 2.24.1, with libpcap 1.0.0, with
libz 1.2.3, without POSIX capabilities, without libpcre, without SMI, without
c-ares, without ADNS, with Lua 5.1, without Python, without GnuTLS, without
Gcrypt, with MIT Kerberos, without GeoIP, with PortAudio V19-devel (built Jan
11
2011 18:26:13), without AirPcap.

Running on Darwin 10.7.0 (Mac OS 10.6.7), with libpcap version 1.0.0, with libz
1.2.3.

Built using gcc 4.2.1 (Apple Inc. build 5666) (dot 3).

--
After adding a ProtoField.bytes to a TreeItem without a tvb, calling set_len()
on the resulting TreeItem causes Wireshark to crash. Note that Wireshark
doesn't crash if the ProtoField type is a number or string. Even though it
doesn't make sense to call set_len() on an item that doesn't have a Tvb,
Wireshark should not crash.

There were no print-outs to stdout at the time of the crash.


Example Lua:
----------->

local proto_foo = Proto("foo", "Foo Protocol")
proto_foo.fields.bytes = ProtoField.bytes("foo.bytes", "Byte array")

function proto_foo.dissector(buf, pinfo, tree)
    local t = tree:add(proto_foo, buf())

    -- Add field without Tvb
    local t2 = t:add(proto_foo.fields.bytes, "test")

    -- CRASH HERE!
    t2:set_len(4)    
end

udp_table = DissectorTable.get("udp.port")
udp_table:add(7777, proto_foo)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.