summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2017-06-14 09:42:31 +1000
committerSteve Hay <steve.m.hay@googlemail.com>2017-08-23 21:21:05 +0100
commit6aaabe5196719b29658e550df4d13c7984a10408 (patch)
tree2ec70c21abe139a8c1434b82191b9d66d9120998 /numeric.c
parent6e35e9969781d5b6932a8fd1f2c4973b6350a845 (diff)
downloadperl-6aaabe5196719b29658e550df4d13c7984a10408.tar.gz
(perl #131526) don't go beyond the end of the NUL in my_atof2
Perl_my_atof2() calls GROK_NUMERIC_RADIX() to detect and skip past a decimal point and then can increment the parse pointer (s) before checking what it points at, so skipping the terminating NUL if the decimal point is immediately before the NUL. (cherry picked from commit 9604fbf0722bd97ca6031a263c50ad52b6633db7)
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/numeric.c b/numeric.c
index 6ea6968c27..5771907b2e 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1485,9 +1485,9 @@ Perl_my_atof2(pTHX_ const char* orig, NV* value)
else if (!seen_dp && GROK_NUMERIC_RADIX(&s, send)) {
seen_dp = 1;
if (sig_digits > MAX_SIG_DIGITS) {
- do {
+ while (isDIGIT(*s)) {
++s;
- } while (isDIGIT(*s));
+ }
break;
}
}