From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11617 invoked by alias); 14 Jun 2004 17:14:32 -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 11591 invoked from network); 14 Jun 2004 17:14:31 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sourceware.org with SMTP; 14 Jun 2004 17:14:31 -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 760E56F3A4E for ; Mon, 14 Jun 2004 19:14:28 +0200 (CEST) Date: Mon, 14 Jun 2004 17:14:00 -0000 From: Thorsten Kukuk To: libc-hacker@sources.redhat.com Subject: asprintf/psignal.c change really correct? Message-ID: <20040614171428.GA22354@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: SuSE Linux AG, Nuernberg, Germany User-Agent: Mutt/1.5.6i X-SW-Source: 2004-06/txt/msg00027.txt.bz2 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. Thorsten --- old/glibc-2.3/stdio-common/psignal.c 2004-03-19 08:30:54.000000000 +0100 +++ new/glibc-2.3/stdio-common/psignal.c 2004-06-14 17:03:29.000000000 +0200 @@ -57,7 +57,13 @@ { char *buf; - (void) __asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig); + if (__asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig) < 0) + { + if (_IO_fwide (stderr, 0) > 0) + (void) __fwprintf (stderr, L"%s%s%s\n", s, colon, _("Unknown signal")); + else + (void) fprintf (stderr, "%s%s%s\n", s, colon, _("Unknown signal")); + } if (_IO_fwide (stderr, 0) > 0) (void) __fwprintf (stderr, L"%s", buf); -- Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de SuSE Linux AG Maxfeldstr. 5 D-90409 Nuernberg -------------------------------------------------------------------- Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B