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] [Wireshark-commits] rev 27948: /trunk/epan/ /trunk/epan/: emem.c

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


From: Jeff Morriss <jeff.morriss.ws@xxxxxxxxx>
Date: Fri, 03 Apr 2009 14:13:19 -0400



Guy Harris wrote:
On Apr 3, 2009, at 10:32 AM, jmayer@xxxxxxxxxxxxx wrote:

Don't crash on linux:
strlen(NULL) isn't an acceptable call.

I'd be somewhat surprised if there's a platform out there on which we run where strlen(NULL) *doesn't* crash; on most if not all platforms on which we run:

	1) NULL has all of its bits zero;

2) at least one page of address space starting at 0 is deliberately missing (to catch null-pointer dereferences);

and I suspect most if not all implementations of strlen() don't explicitly check for a null argument.

I have this vague recollection of some platform not minding being handed NULL pointers to strings; I think it caused me some grief while porting to Solaris. HPUX maybe?

  • References:
    • Re: [Wireshark-dev] [Wireshark-commits] rev 27948: /trunk/epan/ /trunk/epan/: emem.c
      • From: Guy Harris
  • Prev by Date: [Wireshark-dev] slow startup caused by splash_update?
  • Next by Date: [Wireshark-dev] buildbot failure in Wireshark (development) on OSX-10.5-x86
  • Previous by thread: Re: [Wireshark-dev] [Wireshark-commits] rev 27948: /trunk/epan/ /trunk/epan/: emem.c
  • Next by thread: [Wireshark-dev] buildbot failure in Wireshark (development) on Solaris-10-SPARC
  • Index(es):
    • Date
    • Thread

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