PyString_FromString: this requires its argument be non-NULL, but doesn't

check it.  Added an assert() to that effect.
This commit is contained in:
Tim Peters 2001-12-06 20:29:32 +00:00
parent 604ddf80d8
commit 62de65b25e

View file

@ -105,8 +105,11 @@ PyString_FromStringAndSize(const char *str, int size)
PyObject *
PyString_FromString(const char *str)
{
register size_t size = strlen(str);
register size_t size;
register PyStringObject *op;
assert(str != NULL);
size = strlen(str);
if (size > INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"string is too long for a Python string");