From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3116 invoked by alias); 14 Jun 2004 18:16:47 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 3086 invoked from network); 14 Jun 2004 18:16:44 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 14 Jun 2004 18:16:44 -0000 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 19CFE6F396C for ; Mon, 14 Jun 2004 20:16:44 +0200 (CEST) To: Thorsten Kukuk Cc: libc-hacker@sources.redhat.com Subject: Re: asprintf/psignal.c change really correct? References: <20040614171428.GA22354@suse.de> From: Andreas Schwab X-Yow: BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI-BI- Date: Mon, 14 Jun 2004 18:16:00 -0000 In-Reply-To: <20040614171428.GA22354@suse.de> (Thorsten Kukuk's message of "Mon, 14 Jun 2004 19:14:28 +0200") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2004-06/txt/msg00028.txt.bz2 Thorsten Kukuk writes: > Hi, > > We have the following change in current glibc CVS. > I don't think that it is correct: if asprintf fails, we > use fprintf or fwprintf. But than we access buf and try to > print the content. But buf is undefined here. This should work: 2004-06-14 Andreas Schwab * stdio-common/psignal.c (psignal): Don't use buf when asprintf failed. --- stdio-common/psignal.c 03 Jun 2004 12:59:50 +0200 1.11 +++ stdio-common/psignal.c 14 Jun 2004 20:11:58 +0200 @@ -64,12 +64,14 @@ psignal (int sig, const char *s) else (void) fprintf (stderr, "%s%s%s\n", s, colon, _("Unknown signal")); } - - if (_IO_fwide (stderr, 0) > 0) - (void) __fwprintf (stderr, L"%s", buf); else - (void) fputs (buf, stderr); + { + if (_IO_fwide (stderr, 0) > 0) + (void) __fwprintf (stderr, L"%s", buf); + else + (void) fputs (buf, stderr); - free (buf); + free (buf); + } } } Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."