summaryrefslogtreecommitdiff
path: root/Python/pystrtod.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-07-03 12:19:50 +0000
committerMartin v. Löwis <martin@v.loewis.de>2006-07-03 12:19:50 +0000
commit38a4852a011a92b6469f45323e400c132aa19db0 (patch)
tree5b4ed26c7c8496dad7771c69e41e332c6747b1a4 /Python/pystrtod.c
parent5f463b4b12dcdeadce99dfaf8d7cc954b770f636 (diff)
downloadcpython-38a4852a011a92b6469f45323e400c132aa19db0.tar.gz
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
Diffstat (limited to 'Python/pystrtod.c')
-rw-r--r--Python/pystrtod.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index e1c84ea03e..6c19b45fd2 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 */
}