Skip to content

Commit

Permalink
bpo-36030: Fix a possible segfault in PyTuple_New() (pythonGH-15670)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZackerySpytz authored and vstinner committed Sep 4, 2019
1 parent 675d17c commit 60bd1f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Objects/tupleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ PyTuple_New(Py_ssize_t size)
}
#endif
op = tuple_alloc(size);
if (op == NULL) {
return NULL;
}
for (Py_ssize_t i = 0; i < size; i++) {
op->ob_item[i] = NULL;
}
Expand Down

0 comments on commit 60bd1f8

Please sign in to comment.