Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] Should tvb always be != NULL

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 3 Oct 2008 00:34:06 -0700


On Oct 3, 2008, at 12:25 AM, Jaap Keuter wrote:

Bug 2934 brings to light an interesting question: Should proto_tree_add_??? always have a valid tvb? Sounds logical for every call that adds a value, but not so much for _add_text(). The bug states that there are dissectors which make
that call without a tvb, and this leads to a crash.
Should the (epan and other) code be prepared for tvb == NULL, or should we
DISSECTOR_ASSERT(tvb)?

If tvb is null, how can the range of bytes in the top-level packet data corresponding to the item being entered into the protocol tree be determined? The offset passed to proto_tree_add_xxx is relative to the beginning of a tvbuff.

I guess if the length of the field is 0, tvb could be null; a zero- length field is used for, among other things, fields that don't correspond to any data in the packet.

  • References:
    • [Wireshark-dev] Should tvb always be != NULL
      • From: Jaap Keuter
  • Prev by Date: [Wireshark-dev] Should tvb always be != NULL
  • Next by Date: [Wireshark-dev] help
  • Previous by thread: [Wireshark-dev] Should tvb always be != NULL
  • Next by thread: [Wireshark-dev] help
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation