From 8130bbc4796db9eefca6dc4a80bc58f41e32427f Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 24 Feb 2024 23:03:15 +0900 Subject: [PATCH] string.c (mrb_str_len_to_dbl): should return zero for invalid string We should not use uninitialized value; fix #6183 --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string.c b/src/string.c index ee9039770..4c93d2ab2 100644 --- a/src/string.c +++ b/src/string.c @@ -2734,7 +2734,7 @@ bad: mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid string for float(%!s)", s); /* not reached */ } - return d; + return 0.0; } if (badcheck) { if (!end || p == end) goto bad;