SHA256
1
0
forked from pool/python
Adrian Schröter 2008-04-17 06:56:32 +00:00 committed by Git OBS Bridge
parent 0db1166d39
commit 04c7392cbd

View File

@ -0,0 +1,15 @@
--- python/trunk/Objects/stringobject.c 2008/03/26 12:49:49 61936
+++ python/trunk/Objects/stringobject.c 2008/04/10 19:50:36 62271
@@ -55,7 +55,11 @@
PyString_FromStringAndSize(const char *str, Py_ssize_t size)
{
register PyStringObject *op;
- assert(size >= 0);
+ if (size < 0) {
+ PyErr_SetString(PyExc_SystemError,
+ "Negative size passed to PyString_FromStringAndSize");
+ return NULL;
+ }
if (size == 0 && (op = nullstring) != NULL) {
#ifdef COUNT_ALLOCS
null_strings++;