From 911a49d5a609b5fcf803d38156eb793e864138a0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 13 Jul 2010 10:07:23 +0200 Subject: [PATCH] strtod: Add safety check. --- ChangeLog | 5 +++++ lib/strtod.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 67609e96c8..10d49b197e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-07-13 Bruno Haible + + strtod: Add safety check. + * lib/strtod.c (ldexp): Abort if this dummy replacement gets called. + 2010-07-12 Bruno Haible Unify tests that set gl_cv_func_ldexpl_no_libm. diff --git a/lib/strtod.c b/lib/strtod.c index 61887598ca..83b858ae5e 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -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 -- 2.30.2