From e56dfd967ce460481a9922d14e931b438548093d Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 11 Nov 2019 14:43:42 +1100 Subject: handle s being updated without len being updated fix #17279 --- numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index f5fc1f634a..2b880376bd 100644 --- a/numeric.c +++ b/numeric.c @@ -1560,7 +1560,7 @@ Perl_my_atof3(pTHX_ const char* orig, NV* value, const STRLEN len) /* strtold() accepts 0x-prefixed hex and in POSIX implementations, 0b-prefixed binary numbers, which is backward incompatible */ - if ((len == 0 || len >= 2) && *s == '0' && + if ((len == 0 || len - (s-orig) >= 2) && *s == '0' && (isALPHA_FOLD_EQ(s[1], 'x') || isALPHA_FOLD_EQ(s[1], 'b'))) { *value = 0; return (char *)s+1; -- cgit v1.2.1