From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26855 invoked by alias); 5 Apr 2003 00:09:30 -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 26839 invoked from network); 5 Apr 2003 00:09:30 -0000 Received: from unknown (HELO localhost.localdomain) (195.113.19.66) by sources.redhat.com with SMTP; 5 Apr 2003 00:09:30 -0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id h3509RqO010521; Sat, 5 Apr 2003 02:09:27 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.12.8/8.12.8/Submit) id h3509ReB010519; Sat, 5 Apr 2003 02:09:27 +0200 Date: Sat, 05 Apr 2003 00:09:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix __register_printf_function Message-ID: <20030405000927.GT16629@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-04/txt/msg00019.txt.bz2 Hi! Using uninited memory is bad idea, sorry. 2003-04-05 Jakub Jelinek * stdio-common/reg-printf.c (__register_printf_function): Calloc instead of malloc __printf_arginfo_table and __printf_function_table. Reported by John Reiser . --- libc/stdio-common/reg-printf.c.jj 2002-11-05 17:12:55.000000000 -0500 +++ libc/stdio-common/reg-printf.c 2003-04-04 19:04:45.000000000 -0500 @@ -46,7 +46,7 @@ __register_printf_function (spec, conver if (__printf_function_table == NULL) { __printf_arginfo_table = (printf_arginfo_function **) - malloc ((UCHAR_MAX + 1) * sizeof (void *) * 2); + calloc ((UCHAR_MAX + 1), sizeof (void *) * 2); if (__printf_arginfo_table == NULL) return -1; __printf_function_table = (printf_function **) Jakub