From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:27:09 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 B596D106564A for ; Wed, 23 Apr 2008 16:27:09 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9C28FC14 for ; Wed, 23 Apr 2008 16:27:07 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id AF21E679BFC; Wed, 23 Apr 2008 18:26:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0nBcb80Vpz+v; Wed, 23 Apr 2008 18:26:36 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4B87E679B12; Wed, 23 Apr 2008 18:26:36 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m3NGQZxP042659; Wed, 23 Apr 2008 18:26:35 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 23 Apr 2008 18:26:35 +0200 From: Roman Divacky To: Mike Meyer Message-ID: <20080423162635.GA42593@freebsd.org> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <20080423113951.020f0130@mbook-fbsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080423113951.020f0130@mbook-fbsd> User-Agent: Mutt/1.4.2.3i Cc: hackers@freebsd.org, Garrett Cooper , Mike Meyer 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 16:27:09 -0000 > I think someone gave the reason I'm about to: trying to copy a NULL > pointer means I have a bug somewhere earlier in my code that will > eventually produce visibly wrong results - a segfault being such. The > sooner that happens after the bug, the less code I have to search to > find it, the better for me. if only the fix was something else than if (ptr != NULL) strdup(ptr); :)