This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-676-g2fd8978


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2fd8978571e1afecb46149f7886aa7deb9bceedc (commit)
      from  6e099e57a7084e17eb3b3aa5e30264a930c4be37 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2fd8978571e1afecb46149f7886aa7deb9bceedc

commit 2fd8978571e1afecb46149f7886aa7deb9bceedc
Author: Marcus Shawcroft <marcus.shawcroft@linaro.org>
Date:   Thu Nov 15 18:02:03 2012 +0000

    Fix buffer overflow in libm-test.inc check_complex()

diff --git a/ChangeLog b/ChangeLog
index 0f4c503..fa27958 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
 	* debug/pcprofiledump.c (print_version): Update copyright year.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 74488e7..225a5e1 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -627,9 +627,11 @@ check_complex (const char *test_name, __complex__ FLOAT computed,
 {
   FLOAT part_comp, part_exp, part_max_ulp;
   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_exp = __real__ expected;
   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,
 			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_exp = __imag__ expected;
   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,
 			exception & IGNORE_ZERO_INF_SIGN,
 			&imag_max_error);
+  free (str);
 }
 
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    4 ++++
 math/libm-test.inc |   12 +++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]