Your message dated Thu, 4 Dec 2003 11:58:19 -0500
with message-id <[EMAIL PROTECTED]>
and subject line Bug#222891: libc6: strdup (NULL) segfaults
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 4 Dec 2003 16:02:05 +0000
>From [EMAIL PROTECTED] Thu Dec 04 10:02:04 2003
Return-path: <[EMAIL PROTECTED]>
Received: from 86.red-80-24-13.pooles.rima-tde.net (bilbo) [80.24.13.86] 
        by master.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1ARvdZ-00066Q-00; Thu, 04 Dec 2003 09:43:34 -0600
Received: from aragorn ([192.168.0.3])
        by bilbo with esmtp (Exim 3.35 #1 (Debian))
        id 1ARvjp-0004oR-00; Thu, 04 Dec 2003 16:49:57 +0100
Received: from rmh by aragorn with local (Exim 3.36 #1 (Debian))
        id 1ARvZK-0005wa-00; Thu, 04 Dec 2003 16:39:06 +0100
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Robert Millan <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: libc6: strdup (NULL) segfaults
X-Mailer: reportbug 2.36
Date: Thu, 04 Dec 2003 16:39:05 +0100
Message-Id: <[EMAIL PROTECTED]>
Sender: <[EMAIL PROTECTED]>
X-BadReturnPath: [EMAIL PROTECTED] rewritten as [EMAIL PROTECTED]
  using "From" header
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 
        2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20 
        (1.212-2003-09-23-exp) on master.debian.org
X-Spam-Status: No, hits=-5.0 required=4.0 tests=HAS_PACKAGE autolearn=no 
        version=2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20
X-Spam-Level: 

Package: libc6
Version: 2.3.2.ds1-10
Severity: normal

Calling strdup (NULL) causes a segmentation fault in libc:

  Starting program: /tmp/test

  Program received signal SIGSEGV, Segmentation fault.
  0x40098a8f in strlen () from /lib/libc.so.6

The documentation doesn't say the string can't be NULL. When that happens,
I'd expect it to not segfault and return NULL either.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux aragorn 2.4.18-1-k7 #3 Sat Nov 29 10:23:13 EST 2003 i686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED]

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

-- no debconf information


---------------------------------------
Received: (at 222891-done) by bugs.debian.org; 4 Dec 2003 17:08:34 +0000
>From [EMAIL PROTECTED] Thu Dec 04 11:08:34 2003
Return-path: <[EMAIL PROTECTED]>
Received: from nevyn.them.org [66.93.172.17] 
        by master.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1ARwo4-0007u7-00; Thu, 04 Dec 2003 10:58:25 -0600
Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian))
        id 1ARwnz-0001Gi-9B; Thu, 04 Dec 2003 11:58:19 -0500
Date: Thu, 4 Dec 2003 11:58:19 -0500
From: Daniel Jacobowitz <[EMAIL PROTECTED]>
To: Robert Millan <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: Bug#222891: libc6: strdup (NULL) segfaults
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <[EMAIL PROTECTED]>
User-Agent: Mutt/1.5.1i
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 
        2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20 
        (1.212-2003-09-23-exp) on master.debian.org
X-Spam-Status: No, hits=-1.5 required=4.0 tests=FOOASDF,HAS_BUG_NUMBER,
        NO_OBLIGATION autolearn=no 
        version=2.60-master.debian.org_2003_11_25-bugs.debian.org_2003_11_20
X-Spam-Level: 

On Thu, Dec 04, 2003 at 04:39:05PM +0100, Robert Millan wrote:
> Package: libc6
> Version: 2.3.2.ds1-10
> Severity: normal
> 
> Calling strdup (NULL) causes a segmentation fault in libc:
> 
>   Starting program: /tmp/test
> 
>   Program received signal SIGSEGV, Segmentation fault.
>   0x40098a8f in strlen () from /lib/libc.so.6
> 
> The documentation doesn't say the string can't be NULL. When that happens,
> I'd expect it to not segfault and return NULL either.

This is not a bug.

DESCRIPTION
       The  strdup() function returns a pointer to a new string which
is a duplicate of the string s.

NULL is not a valid string argument, so the function has no obligation
to behave reasonably.  So it doesn't.  This is standard behavior for
just about all C library functions.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to