From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 07:22:52 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 49DBF1065673 for ; Thu, 24 Apr 2008 07:22:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 436048FC14 for ; Thu, 24 Apr 2008 07:22:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id C0FBD46B0C; Thu, 24 Apr 2008 03:22:51 -0400 (EDT) Date: Thu, 24 Apr 2008 08:22:51 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bakul Shah In-Reply-To: <20080423185431.3FA615BB1@mail.bitblocks.com> Message-ID: <20080424082155.G10114@fledge.watson.org> References: <20080423185431.3FA615BB1@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Garrett Cooper , hackers@freebsd.org Subject: Re: Fwd: 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: Thu, 24 Apr 2008 07:22:52 -0000 On Wed, 23 Apr 2008, Bakul Shah wrote: > The *exception* is where a function is explicitly prepared to handle NULLs. > One must read its man page carefully and if it doesn't say anything about > how NULLs in place of ptrs are handled, one must not pass in NULLs! While I recognize there are some useful consumer simplicity benefits to accepting NULL as an argument to free(3), it's always made me a bit uneasy for this reason. Robert N M Watson Computer Laboratory University of Cambridge