diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-12-06 20:29:32 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-12-06 20:29:32 (GMT) |
commit | 62de65b25e56d01a7cd10f55576ff00eae1021fc (patch) | |
tree | 9961aaac987341f8ce96cc71ff780711bd90151c /Objects/stringobject.c | |
parent | 604ddf80d891f666c677d23b83c3c9f8125ee2b5 (diff) | |
download | cpython-62de65b25e56d01a7cd10f55576ff00eae1021fc.zip cpython-62de65b25e56d01a7cd10f55576ff00eae1021fc.tar.gz cpython-62de65b25e56d01a7cd10f55576ff00eae1021fc.tar.bz2 |
PyString_FromString: this requires its argument be non-NULL, but doesn't
check it. Added an assert() to that effect.
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r-- | Objects/stringobject.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index cb0e20b..657b200 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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"); |