Wireshark-bugs: [Wireshark-bugs] [Bug 5954] New: Assert in 6LoWPAN Dissector when opening corrup

Date: Wed, 25 May 2011 04:55:02 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5954

           Summary: Assert in 6LoWPAN Dissector when opening corrupt FRAG1
                    Packet
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: coflynn@xxxxxxxxx


Created an attachment (id=6392)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=6392)
Example which triggers the assert

Build Information:
TShark 1.7.0 (SVN Rev 37390 from /trunk)

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 GLib 2.26.0, with libpcap 1.1.1, with libz 1.2.5, with
POSIX capabilities (Linux), without libpcre, without SMI, without c-ares,
without ADNS, without Lua, without Python, with GnuTLS 2.8.6, with Gcrypt
1.4.5,
with MIT Kerberos, without GeoIP.

Running on Linux 2.6.35.11-83.fc14.x86_64, with libpcap version 1.1.1, with
libz
1.2.5.

Built using gcc 4.5.1 20100924 (Red Hat 4.5.1-4).

--
Opening a corrupt 6LoWPAN packet may trigger a dissector bug, with the
following error:

** (process:15471): WARNING **: Dissector bug, protocol 6LoWPAN, in packet 1:
tvbuff.c:633: failed assertion "tvb && tvb->initialized"

The reason is around line 2023 of packet-6lowpan.c. There are a number of calls
to dissect_6lowpan_xxx() which return a 'tvb' type. If the calls fail the tvb
is NULL, but that condition is never checked.

Attached file fixes that by introducing a simple check:

    /* Check call to dissect_6lowpan_xxx was successful */
    if (frag_tvb == NULL) {
        return NULL;
    }

The sub-dissectors which were called should print expert info messages when
they return NULL, so I don't think any additional expert info message is
required when we fail here.

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