Kaydet (Commit) 95c1e506 authored tarafından Neal Norwitz's avatar Neal Norwitz

SF bug #1331563 ] string_subscript doesn't check for failed PyMem_Malloc. Will backport

üst 5c4a9d65
......@@ -1198,6 +1198,8 @@ string_subscript(PyStringObject* self, PyObject* item)
else {
source_buf = PyString_AsString((PyObject*)self);
result_buf = PyMem_Malloc(slicelength);
if (result_buf == NULL)
return PyErr_NoMemory();
for (cur = start, i = 0; i < slicelength;
cur += step, i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment