strtod: Add safety check.
authorBruno Haible <bruno@clisp.org>
Tue, 13 Jul 2010 08:07:23 +0000 (10:07 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 13 Jul 2010 08:07:23 +0000 (10:07 +0200)
ChangeLog
lib/strtod.c

index 67609e96c834cf85e32a681c2619c44e66ac7aa1..10d49b197eb6f4da5ee8a0a3a5c45b145b99f843 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-13  Bruno Haible  <bruno@clisp.org>
+
+       strtod: Add safety check.
+       * lib/strtod.c (ldexp): Abort if this dummy replacement gets called.
+
 2010-07-12  Bruno Haible  <bruno@clisp.org>
 
        Unify tests that set gl_cv_func_ldexpl_no_libm.
index 61887598cab0543097841b015906ffe526747013..83b858ae5e7cb23f0c4b1d1bb2ae1263b497be04 100644 (file)
@@ -45,7 +45,12 @@ locale_isspace (char c)
 
 #if !HAVE_LDEXP_IN_LIBC
  #define ldexp dummy_ldexp
- static double ldexp (double x, int exponent) { return x + exponent; }
+ /* A dummy definition that will never be invoked.  */
+ static double ldexp (double x _GL_UNUSED, int exponent _GL_UNUSED)
+ {
+   abort ();
+   return 0.0;
+ }
 #endif
 
 /* Return X * BASE**EXPONENT.  Return an extreme value and set errno