diff options
author | Tim Peters <tim.peters@gmail.com> | 2002-04-14 22:04:03 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2002-04-14 22:04:03 (GMT) |
commit | 077f27141fbd31849d6bba074e445bf391a0e6f4 (patch) | |
tree | 752b029eda4906ce8a003049eaa8d1bd1feaa555 /Objects | |
parent | 518d261f632e3b0ea6869756da39025fd23a9a6e (diff) | |
download | cpython-077f27141fbd31849d6bba074e445bf391a0e6f4.zip cpython-077f27141fbd31849d6bba074e445bf391a0e6f4.tar.gz cpython-077f27141fbd31849d6bba074e445bf391a0e6f4.tar.bz2 |
SF bug 543840: complex(string) accepts strings with \0
complex_subtype_from_string(): this stopped parsing at the first 0
byte, as if that were the end of the input string.
Bugfix candidate.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/complexobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 3dbaea3..c074aee 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -787,7 +787,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v) } /* end of switch */ - } while (*s!='\0' && !sw_error); + } while (s - start < len && !sw_error); if (sw_error) { PyErr_SetString(PyExc_ValueError, |