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.
This commit is contained in:
Tim Peters 2002-04-14 22:04:03 +00:00
parent 518d261f63
commit 077f27141f
2 changed files with 14 additions and 1 deletions

View file

@ -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,