From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 07:21:14 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7106D1065673 for ; Wed, 23 Apr 2008 07:21:14 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 499CC8FC1C for ; Wed, 23 Apr 2008 07:21:14 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:60e1:fceb:2bfc:7da0] (unknown [IPv6:2001:7b8:3a7:0:60e1:fceb:2bfc:7da0]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTP id CDA053C; Wed, 23 Apr 2008 09:21:12 +0200 (CEST) Message-ID: <480EE369.5090508@andric.com> Date: Wed, 23 Apr 2008 09:21:13 +0200 From: Dimitry Andric User-Agent: Thunderbird 2.0.0.15pre (Windows/20080409) MIME-Version: 1.0 To: Garrett Cooper References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> In-Reply-To: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 07:21:14 -0000 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. :)