This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Resolve buffer overflow in libm-test-inc check_complex()
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Marcus Shawcroft <marcus dot shawcroft at linaro dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 14 Nov 2012 23:11:28 +0000
- Subject: Re: [PATCH] Resolve buffer overflow in libm-test-inc check_complex()
- References: <CABXK9ndZtRHT2iOK1_CX25i6+bqm5sie3G-DL3aM8JKB8KqyAA@mail.gmail.com>
On Wed, 14 Nov 2012, Marcus Shawcroft wrote:
> 2012-11-14 Marcus Shawcroft <marcus.shawcroft@linaro.org>
>
> * math/libm-test.inc (check_complex): Use asprintf.
When using asprintf, please check the return value and produce an
appropriate error if it is -1 (maybe just abort the test, in this case).
(If the return value is -1, the value of the pointer asprintf sets is
undefined, so you do need to check the return value before using that
pointer.)
--
Joseph S. Myers
joseph@codesourcery.com