[Python-checkins] python/dist/src/Objects stringobject.c, 2.233, 2.234

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Thu Oct 20 06:15:56 CEST 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18773/Objects

Modified Files:
	stringobject.c 
Log Message:
SF bug #1331563 ] string_subscript doesn't check for failed PyMem_Malloc.  Will backport

Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.233
retrieving revision 2.234
diff -u -d -r2.233 -r2.234
--- stringobject.c	1 Oct 2005 17:06:00 -0000	2.233
+++ stringobject.c	20 Oct 2005 04:15:52 -0000	2.234
@@ -1198,6 +1198,8 @@
 		else {
 			source_buf = PyString_AsString((PyObject*)self);
 			result_buf = PyMem_Malloc(slicelength);
+			if (result_buf == NULL)
+				return PyErr_NoMemory();
 
 			for (cur = start, i = 0; i < slicelength; 
 			     cur += step, i++) {



More information about the Python-checkins mailing list