summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-08-20 09:13:58 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-08-20 09:13:58 (GMT)
commit6adf2433e4e1936dba5335311b3f86051156eb81 (patch)
treea63ac76871e98f90d018166a4f1dec8d3e257e0a /Objects
parentbac9a53d007e291b2b32da326def92e71d79191f (diff)
parentfd24f9e51e80fb050e4239f6909eaff2d29ec30d (diff)
downloadcpython-6adf2433e4e1936dba5335311b3f86051156eb81.zip
cpython-6adf2433e4e1936dba5335311b3f86051156eb81.tar.gz
cpython-6adf2433e4e1936dba5335311b3f86051156eb81.tar.bz2
Merge 3.2.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index aa43b72..5ac4ac9 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2718,6 +2718,11 @@ _PySequence_BytesToCharpArray(PyObject* self)
for (i = 0; i < argc; ++i) {
char *data;
item = PySequence_GetItem(self, i);
+ if (item == NULL) {
+ /* NULL terminate before freeing. */
+ array[i] = NULL;
+ goto fail;
+ }
data = PyBytes_AsString(item);
if (data == NULL) {
/* NULL terminate before freeing. */