diff Modules/arraymodule.c @ 40014:5d93e5ccb31e 2.4

[Partial backport of r51218 | neal.norwitz -- the changes to ast.c, symtable.c, and _elementtree.c weren't applicable] Klocwork made another run and found a bunch more problems. This is the first batch of fixes that should be easy to verify based on context. This fixes problem numbers: 220 (ast), 323-324 (symtable), 321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
author Andrew M. Kuchling <amk@amk.ca>
date Thu, 05 Oct 2006 18:37:08 +0000
parents 6fb46e87d5f9
children 0565130d7d9f
line wrap: on
line diff
--- a/Modules/arraymodule.c	Thu Oct 05 18:22:02 2006 +0000
+++ b/Modules/arraymodule.c	Thu Oct 05 18:37:08 2006 +0000
@@ -701,6 +701,8 @@
 			/* Special case "a[i:j] = a" -- copy b first */
 			int ret;
 			v = array_slice(b, 0, n);
+			if (!v)
+				return -1;
 			ret = array_ass_slice(a, ilow, ihigh, v);
 			Py_DECREF(v);
 			return ret;
@@ -1687,6 +1689,8 @@
 			if (self == av) { 
 				value = array_slice(av, 0, av->ob_size);
 				av = (arrayobject*)value;
+				if (!av)
+					return -1;
 			} 
 			else {
 				Py_INCREF(value);