summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-11-11 14:43:42 +1100
committerTony Cook <tony@develop-help.com>2019-11-12 07:46:10 +1100
commite56dfd967ce460481a9922d14e931b438548093d (patch)
treeeb4ecc110a2133f619bc1c0b38e5c91bc0a567a4 /numeric.c
parent9e0c85b92fb133a122394815017a828f27c7e530 (diff)
downloadperl-e56dfd967ce460481a9922d14e931b438548093d.tar.gz
handle s being updated without len being updated
fix #17279
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
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;