Wireshark mailing list archives
Re: DND crash through all versions?
From: Tony Trinh <tony19 () gmail com>
Date: Mon, 3 Sep 2012 18:36:56 -0400
On Mon, Sep 3, 2012 at 5:50 PM, Jaap Keuter <jaap.keuter () xs4all nl> wrote:
Anyone knows what strstr() does with a NULL for a haystack? As far as I can tell it's unspecified.
I think you're right. "Undefined/unspecified behavior" usually means a segfault from my experience. This is true for strstr() in OSX ML. strstr() apparently does not null-check its parameters in the latest versions of Linux [1], OSX/Darwin (and probably other Un*x) [2], and Windows [3]. I couldn't find the Windows source for strstr(), but MSDN indicates: strstr and wcsstr do not validate their parameters. Interestingly, Windows does have an error handler in _mbsstr() for invalid parameters. [1]: http://lxr.linux.no/linux+v3.5.3/lib/string.c [2]: http://www.opensource.apple.com/source/xnu/xnu-792.13.8/libsa/strstr.c [3]: http://msdn.microsoft.com/en-us/library/z9da80kz.aspx
___________________________________________________________________________ Sent via: Wireshark-dev mailing list <wireshark-dev () wireshark org> Archives: http://www.wireshark.org/lists/wireshark-dev Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev mailto:wireshark-dev-request () wireshark org?subject=unsubscribe
Current thread:
- DND crash through all versions? Jaap Keuter (Sep 03)
- Re: DND crash through all versions? Jakub Zawadzki (Sep 03)
- Re: DND crash through all versions? Tony Trinh (Sep 03)
- Re: DND crash through all versions? Jaap Keuter (Sep 03)
- Re: DND crash through all versions? Joerg Mayer (Sep 03)
- Re: DND crash through all versions? Jaap Keuter (Sep 04)
- Re: DND crash through all versions? Jeff Morriss (Sep 04)
- Re: DND crash through all versions? Christopher Maynard (Sep 04)
- Re: DND crash through all versions? Jaap Keuter (Sep 04)
- Re: DND crash through all versions? Jaap Keuter (Sep 04)
- Re: DND crash through all versions? Jaap Keuter (Sep 21)
- Re: DND crash through all versions? Jaap Keuter (Sep 22)
- Re: DND crash through all versions? Dirk Jagdmann (Sep 23)
- Re: DND crash through all versions? Joerg Mayer (Sep 03)