diff Modules/_codecsmodule.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 82f56207652f
children c02a33788a8f
line wrap: on
line diff
--- a/Modules/_codecsmodule.c	Fri Aug 11 19:55:35 2006 +0000
+++ b/Modules/_codecsmodule.c	Sat Aug 12 01:43:40 2006 +0000
@@ -192,7 +192,8 @@
 	buf = PyString_AS_STRING (str);
 	len = PyString_GET_SIZE (str);
 	memmove(buf, buf+1, len-2);
-	_PyString_Resize(&str, len-2);
+	if (_PyString_Resize(&str, len-2) < 0)
+		return NULL;
 	
 	return codec_tuple(str, PyString_Size(str));
 }