From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11614 invoked by alias); 17 May 2005 19:02:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9143 invoked from network); 17 May 2005 19:01:36 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sourceware.org with SMTP; 17 May 2005 19:01:36 -0000 Received: from zaretski (IGLD-80-230-68-227.inter.net.il [80.230.68.227]) by legolas.inter.net.il (MOS 3.5.6-GR) with ESMTP id EJZ65230 (AUTH halo1); Tue, 17 May 2005 22:01:30 +0300 (IDT) Date: Tue, 17 May 2005 20:30:00 -0000 From: "Eli Zaretskii" To: Wu Zhou Message-ID: <01c55b12$Blat.v2.4$8af55500@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: gdb-patches@sources.redhat.com In-reply-to: <1116342801.428a0a113167f@imap.linux.ibm.com> (message from Wu Zhou on Tue, 17 May 2005 11:13:21 -0400) Subject: Re: two questions about GDB coding standards Reply-to: Eli Zaretskii References: <1116342801.428a0a113167f@imap.linux.ibm.com> X-SW-Source: 2005-05/txt/msg00427.txt.bz2 > Date: Tue, 17 May 2005 11:13:21 -0400 > From: Wu Zhou > > 1. In section 13.4.2(memory management), it is said that gdb uses the > string function xstrdup and the print function xasprintf. But I saw > in the source codes that most places use sprintf instead. This is just a matter of converting the uses of sprintf into safer code using xstrdup, xasprintf, xsprintf, etc. Volunteers are welcome. > Besides this in-consistence, we also know that sprintf is very prone > to buffer overflow error. That is precisely why we don't want to use it.