[Python-checkins] python/dist/src/Objects stringobject.c, 2.226, 2.226.2.1

nnorwitz@users.sourceforge.net nnorwitz at users.sourceforge.net
Thu Oct 20 06:16:48 CEST 2005


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

Modified Files:
      Tag: release24-maint
	stringobject.c 
Log Message:
Backport: SF bug #1331563 ] string_subscript doesn't check for failed PyMem_Malloc.

Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.226
retrieving revision 2.226.2.1
diff -u -d -r2.226 -r2.226.2.1
--- stringobject.c	26 Oct 2004 01:52:37 -0000	2.226
+++ stringobject.c	20 Oct 2005 04:16:45 -0000	2.226.2.1
@@ -1184,6 +1184,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