Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2008 09:21:13 +0200
From:      Dimitry Andric <dimitry@andric.com>
To:        Garrett Cooper <yanefbsd@gmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: strdup(NULL) supposed to create SIGSEGV?
Message-ID:  <480EE369.5090508@andric.com>
In-Reply-To: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com>
References:  <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2008-04-23 07:40, Garrett Cooper wrote:
>      I made an oops in a program, which uncovered "feature" in strdup(2)
> that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL)
> supposed to segfault should this just return NULL and set errno?

It could, in fact, tear up the fabric of the universe, or blow up your
machine, if it wanted. :)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?480EE369.5090508>