Browse Source

bpo-36030: Fix a possible segfault in PyTuple_New() (GH-15670)

pull/15681/head
Zackery Spytz 6 years ago
committed by Victor Stinner
parent
commit
60bd1f88f2
  1. 3
      Objects/tupleobject.c

3
Objects/tupleobject.c

@ -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;
}

Loading…
Cancel
Save