forked from pool/python
This commit is contained in:
parent
0db1166d39
commit
04c7392cbd
15
python-2.5.2-from-string-and-size.patch
Normal file
15
python-2.5.2-from-string-and-size.patch
Normal 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++;
|
Loading…
x
Reference in New Issue
Block a user