[Python-checkins] cpython (merge 3.3 -> default): Propagate error when PyByteArray_Resize() fails in bytearray_translate()
christian.heimes
python-checkins at python.org
Sun Jul 21 02:04:55 CEST 2013
http://hg.python.org/cpython/rev/12acefa9ec71
changeset: 84756:12acefa9ec71
parent: 84754:8e42d4d6ad06
parent: 84755:15ac20ee5b70
user: Christian Heimes <christian at cheimes.de>
date: Sun Jul 21 02:04:44 2013 +0200
summary:
Propagate error when PyByteArray_Resize() fails in bytearray_translate()
CID 715334
files:
Objects/bytearrayobject.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -1508,7 +1508,10 @@
}
/* Fix the size of the resulting string */
if (inlen > 0)
- PyByteArray_Resize(result, output - output_start);
+ if (PyByteArray_Resize(result, output - output_start) < 0) {
+ Py_CLEAR(result);
+ goto done;
+ }
done:
if (tableobj != NULL)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list