summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-07-03 12:19:50 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-07-03 12:19:50 (GMT)
commitfcfff0a7fa6ece4c806b6e1a0a66b5ce214b9a28 (patch)
treef7021d6ee71d28238772991a0f367cf632216485 /Python
parent82c276ea332108056e2ca8905547fc184bfe0eb9 (diff)
downloadcpython-fcfff0a7fa6ece4c806b6e1a0a66b5ce214b9a28.zip
cpython-fcfff0a7fa6ece4c806b6e1a0a66b5ce214b9a28.tar.gz
cpython-fcfff0a7fa6ece4c806b6e1a0a66b5ce214b9a28.tar.bz2
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
Diffstat (limited to 'Python')
-rw-r--r--Python/pystrtod.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index e1c84ea..6c19b45 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -90,6 +90,13 @@ PyOS_ascii_strtod(const char *nptr, char **endptr)
p++;
end = p;
}
+ else if (strncmp(p, decimal_point, decimal_point_len) == 0)
+ {
+ /* Python bug #1417699 */
+ *endptr = (char*)nptr;
+ errno = EINVAL;
+ return val;
+ }
/* For the other cases, we need not convert the decimal point */
}