| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,8 @@ Library | |||
| 16 | 16 | - In the curses module, raise an error if window.getstr() or window.instr() is | |
| 17 | 17 | passed a negative value. | |
| 18 | 18 | ||
| 19 | + - Issue #27783: Fix possible usage of uninitialized memory in operator.methodcaller. | ||
| 20 | + | ||
| 19 | 21 | - Issue #27774: Fix possible Py_DECREF on unowned object in _sre. | |
| 20 | 22 | ||
| 21 | 23 | - Issue #27760: Fix possible integer overflow in binascii.b2a_qp. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -801,7 +801,7 @@ static PyObject * | |||
| 801 | 801 | methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |
| 802 | 802 | { | |
| 803 | 803 | methodcallerobject *mc; | |
| 804 | - PyObject *name, *newargs; | ||
| 804 | + PyObject *name; | ||
| 805 | 805 | ||
| 806 | 806 | if (PyTuple_GET_SIZE(args) < 1) { | |
| 807 | 807 | PyErr_SetString(PyExc_TypeError, "methodcaller needs at least " | |
@@ -814,20 +814,19 @@ methodcaller_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |||
| 814 | 814 | if (mc == NULL) | |
| 815 | 815 | return NULL; | |
| 816 | 816 | ||
| 817 | - newargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); | ||
| 818 | - if (newargs == NULL) { | ||
| 819 | - Py_DECREF(mc); | ||
| 820 | - return NULL; | ||
| 821 | - } | ||
| 822 | - mc->args = newargs; | ||
| 823 | - | ||
| 824 | 817 | name = PyTuple_GET_ITEM(args, 0); | |
| 825 | 818 | Py_INCREF(name); | |
| 826 | 819 | mc->name = name; | |
| 827 | 820 | ||
| 828 | 821 | Py_XINCREF(kwds); | |
| 829 | 822 | mc->kwds = kwds; | |
| 830 | 823 | ||
| 824 | + mc->args = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args)); | ||
| 825 | + if (mc->args == NULL) { | ||
| 826 | + Py_DECREF(mc); | ||
| 827 | + return NULL; | ||
| 828 | + } | ||
| 829 | + | ||
| 831 | 830 | PyObject_GC_Track(mc); | |
| 832 | 831 | return (PyObject *)mc; | |
| 833 | 832 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments