diff Modules/arraymodule.c @ 39445:e11caad7e029 legacy-trunk

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 Neal Norwitz <nnorwitz@gmail.com>
date Sat, 12 Aug 2006 01:43:40 +0000
parents 42808526511c
children 6cafdc81cfde
line wrap: on
line diff
--- a/Modules/arraymodule.c	Fri Aug 11 19:55:35 2006 +0000
+++ b/Modules/arraymodule.c	Sat Aug 12 01:43:40 2006 +0000
@@ -702,6 +702,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;
@@ -1708,6 +1710,8 @@
 			if (self == av) { 
 				value = array_slice(av, 0, av->ob_size);
 				av = (arrayobject*)value;
+				if (!av)
+					return -1;
 			} 
 			else {
 				Py_INCREF(value);