From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:06:45 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 5A9801065670 for ; Wed, 23 Apr 2008 16:06:45 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: from web36608.mail.mud.yahoo.com (web36608.mail.mud.yahoo.com [209.191.85.25]) by mx1.freebsd.org (Postfix) with SMTP id EA2FC8FC27 for ; Wed, 23 Apr 2008 16:06:44 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: (qmail 48293 invoked by uid 60001); 23 Apr 2008 16:06:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=qD68y4k2Hhq6hWTmteYkz+O1R9hGLqiiG2q6Yhbjwk9K02bN0/62/F5dgJMLhdAZ5R+s2Jeik4/Xlc8LA1l5PhEk0D5fHxUDwke15N/VEhN2q3BJ4sn0j3JS9qIcvQkzhTbbXqCTO6VY3vEjESZu0Db1wsDpoVrn3gKsmvyatrk=; X-YMail-OSG: gXmjozgVM1m9jCmarEcUvZUsZtmb0.N4tsbvgS9J22CYscRl0wIIdHuIPjcAP.M0e6eif7ZDtlpuaB40Kpk2SMZr5NA_ro5r6s8RALZXstNDStVhO8NpUUDt6yE- Received: from [85.10.53.173] by web36608.mail.mud.yahoo.com via HTTP; Wed, 23 Apr 2008 09:06:44 PDT Date: Wed, 23 Apr 2008 09:06:44 -0700 (PDT) From: Simun Mikecin To: freebsd-nospam@yaxom.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <293918.47889.qm@web36608.mail.mud.yahoo.com> X-Mailman-Approved-At: Wed, 23 Apr 2008 16:11:35 +0000 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 16:06:45 -0000 >If you're going to quote documents to support your ideas, it's probably >better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the first place. And I see that it says: "A null pointer is returned if the new string cannot be created." Does that also mean that a null pointer is returned if the input is a NULL pointer (cause in that case new string could not be created)? As other have concluded, standard says that behavior is undefined if the input is invalid (NULL pointer). So what is right? ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ