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).
This commit is contained in:
Neal Norwitz 2006-08-12 01:43:40 +00:00
parent 2a899c8b76
commit 6f5ff3f3eb
8 changed files with 28 additions and 3 deletions

View file

@ -702,6 +702,8 @@ array_ass_slice(arrayobject *a, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *v)
/* 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 @@ array_ass_subscr(arrayobject* self, PyObject* item, PyObject* value)
if (self == av) {
value = array_slice(av, 0, av->ob_size);
av = (arrayobject*)value;
if (!av)
return -1;
}
else {
Py_INCREF(value);