summaryrefslogtreecommitdiff
path: root/Modules/_codecsmodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-12 01:43:40 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-12 01:43:40 +0000
commit6f5ff3f3eb7abc2f4750c1319b560f67faf546ac (patch)
tree1b84bed27afcf3a62f50a2a2a6dabe162327866a /Modules/_codecsmodule.c
parent2a899c8b767144e809418fd04f83e4e5789084cd (diff)
downloadcpython-git-6f5ff3f3eb7abc2f4750c1319b560f67faf546ac.tar.gz
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).
Diffstat (limited to 'Modules/_codecsmodule.c')
-rw-r--r--Modules/_codecsmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index 405fd7a29a..4dbceb78be 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -192,7 +192,8 @@ escape_encode(PyObject *self,
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));
}