Commit ee60d422 authored by Benjamin Peterson's avatar Benjamin Peterson

merge 3.3 (#27783)

parents f0759f38 9ee93511
...@@ -16,6 +16,8 @@ Library ...@@ -16,6 +16,8 @@ Library
- In the curses module, raise an error if window.getstr() or window.instr() is - In the curses module, raise an error if window.getstr() or window.instr() is
passed a negative value. passed a negative value.
- Issue #27783: Fix possible usage of uninitialized memory in operator.methodcaller.
- Issue #27774: Fix possible Py_DECREF on unowned object in _sre. - Issue #27774: Fix possible Py_DECREF on unowned object in _sre.
- Issue #27760: Fix possible integer overflow in binascii.b2a_qp. - Issue #27760: Fix possible integer overflow in binascii.b2a_qp.
......
...@@ -801,7 +801,7 @@ static PyObject * ...@@ -801,7 +801,7 @@ static PyObject *
methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds) methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
methodcallerobject *mc; methodcallerobject *mc;
PyObject *name, *newargs; PyObject *name;
if (PyTuple_GET_SIZE(args) < 1) { if (PyTuple_GET_SIZE(args) < 1) {
PyErr_SetString(PyExc_TypeError, "methodcaller needs at least " PyErr_SetString(PyExc_TypeError, "methodcaller needs at least "
...@@ -814,13 +814,6 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -814,13 +814,6 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (mc == NULL) if (mc == NULL)
return NULL; return NULL;
newargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
if (newargs == NULL) {
Py_DECREF(mc);
return NULL;
}
mc->args = newargs;
name = PyTuple_GET_ITEM(args, 0); name = PyTuple_GET_ITEM(args, 0);
Py_INCREF(name); Py_INCREF(name);
mc->name = name; mc->name = name;
...@@ -828,6 +821,12 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -828,6 +821,12 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Py_XINCREF(kwds); Py_XINCREF(kwds);
mc->kwds = kwds; mc->kwds = kwds;
mc->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
if (mc->args == NULL) {
Py_DECREF(mc);
return NULL;
}
PyObject_GC_Track(mc); PyObject_GC_Track(mc);
return (PyObject *)mc; return (PyObject *)mc;
} }
......
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