From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6204 invoked by alias); 30 Mar 2010 16:12:30 -0000 Received: (qmail 6191 invoked by uid 22791); 30 Mar 2010 16:12:29 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 16:12:24 +0000 Received: (qmail 775 invoked from network); 30 Mar 2010 16:12:22 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Mar 2010 16:12:22 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [patch] Fix crash on NULL rl_prompt Date: Tue, 30 Mar 2010 16:12:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: Jan Kratochvil References: <20100329234026.GA23895@host0.dyn.jankratochvil.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003301712.20874.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg01053.txt.bz2 On Tuesday 30 March 2010 16:57:28, Tom Tromey wrote: > Jan> BTW don't you think xstrdup (NULL) should == NULL? Like xmalloc > Jan> (0) == NULL. While it is implementation defined if malloc(0) returns NULL or not, xmalloc(0) never returns NULL. Quite the opposite. It makes sure to never call malloc with size 0. I don't think that xstrdup should special case NULL input. It will tend to mask out bugs. It isn't clear to me your patch isn't doing so, FTR. It could have been a readline change only visible when using a more recent system readline, instead of the version bundled with gdb, for example. -- Pedro Alves