This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: two questions about GDB coding standards
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: Wu Zhou <woodzltc at cn dot ibm dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 17 May 2005 21:58:22 +0300
- Subject: Re: two questions about GDB coding standards
- References: <1116342801.428a0a113167f@imap.linux.ibm.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Tue, 17 May 2005 11:13:21 -0400
> From: Wu Zhou <woodzltc@cn.ibm.com>
>
> 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.