Wireshark

  • Riverbed Technology
  • WinPcap
SHARKFEST '13 - Wireshark Developer and User Conference - June 16-19, 2013 - UC Berkeley
  • 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] pcapng, must opt_commentstring be?0-terminated?

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


From: Chris Maynard <Chris.Maynard@xxxxxxxxx>
Date: Mon, 23 Jan 2012 21:30:03 +0000 (UTC)

Martin Kaiser <lists@...> writes:

> I was wondering why we need a static buffer at all. It looks like the
> intention is to keep using the same buffer for each option that we
> parse. When reading an option, how about checking the length first and
> then allocating the buffer dynamically? We could then remove the
> g_strdup() as well and use the allocated buffer to pass the option on to
> wiretap etc.

Your suggestion sounds good to me.

> My understandig is that g_strdup() allocates a copy that the caller must
> free. I don't think that at the moment, anybody is freeing the copy for
> the comment (or for any other option).

If there's a leak, then that should be fixed.  Care to open a bug report and
submit a patch?

- Chris



  • Follow-Ups:
    • Re: [Wireshark-dev] pcapng, must opt_commentstring?be?0-terminated?
      • From: Martin Kaiser
  • References:
    • Re: [Wireshark-dev] pcapng, must opt_comment string be?0-terminated?
      • From: Martin Kaiser
  • Prev by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 40644: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-pgm.c
  • Next by Date: Re: [Wireshark-dev] [Wireshark-commits] rev 40644: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-pgm.c
  • Previous by thread: Re: [Wireshark-dev] pcapng, must opt_comment string be?0-terminated?
  • Next by thread: Re: [Wireshark-dev] pcapng, must opt_commentstring?be?0-terminated?
  • Index(es):
    • Date
    • Thread

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