mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-02 16:01:20 +03:00
Fix buffer overflow in libm-test.inc check_complex()
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2012-11-15 Marcus Shawcroft <marcus.shawcroft@linaro.org>
|
||||||
|
|
||||||
|
* math/libm-test.inc (check_complex): Use asprintf.
|
||||||
|
|
||||||
2012-11-14 Joseph Myers <joseph@codesourcery.com>
|
2012-11-14 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* debug/pcprofiledump.c (print_version): Update copyright year.
|
* debug/pcprofiledump.c (print_version): Update copyright year.
|
||||||
|
@@ -627,9 +627,11 @@ check_complex (const char *test_name, __complex__ FLOAT computed,
|
|||||||
{
|
{
|
||||||
FLOAT part_comp, part_exp, part_max_ulp;
|
FLOAT part_comp, part_exp, part_max_ulp;
|
||||||
int part_xfail;
|
int part_xfail;
|
||||||
char str[200];
|
char *str;
|
||||||
|
|
||||||
|
if (asprintf (&str, "Real part of: %s", test_name) == -1)
|
||||||
|
abort ();
|
||||||
|
|
||||||
sprintf (str, "Real part of: %s", test_name);
|
|
||||||
part_comp = __real__ computed;
|
part_comp = __real__ computed;
|
||||||
part_exp = __real__ expected;
|
part_exp = __real__ expected;
|
||||||
part_max_ulp = __real__ max_ulp;
|
part_max_ulp = __real__ max_ulp;
|
||||||
@@ -637,8 +639,11 @@ check_complex (const char *test_name, __complex__ FLOAT computed,
|
|||||||
|
|
||||||
check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
|
check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
|
||||||
exception, &real_max_error);
|
exception, &real_max_error);
|
||||||
|
free (str);
|
||||||
|
|
||||||
|
if (asprintf (&str, "Imaginary part of: %s", test_name) == -1)
|
||||||
|
abort ();
|
||||||
|
|
||||||
sprintf (str, "Imaginary part of: %s", test_name);
|
|
||||||
part_comp = __imag__ computed;
|
part_comp = __imag__ computed;
|
||||||
part_exp = __imag__ expected;
|
part_exp = __imag__ expected;
|
||||||
part_max_ulp = __imag__ max_ulp;
|
part_max_ulp = __imag__ max_ulp;
|
||||||
@@ -649,6 +654,7 @@ check_complex (const char *test_name, __complex__ FLOAT computed,
|
|||||||
check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
|
check_float_internal (str, part_comp, part_exp, part_max_ulp, part_xfail,
|
||||||
exception & IGNORE_ZERO_INF_SIGN,
|
exception & IGNORE_ZERO_INF_SIGN,
|
||||||
&imag_max_error);
|
&imag_max_error);
|
||||||
|
free (str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user