Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Lib/test/test_pyexpat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,9 @@ def test_set_maximum_amplification__amplification_not_exceeded(self):
self.assertIsNotNone(parser.Parse(payload, True))


@unittest.skipIf(expat.version_info < (2, 7, 2), "requires Expat >= 2.7.2")
@unittest.skipIf(not hasattr(expat.XMLParserType,
"SetAllocTrackerMaximumAmplification"),
"requires Python compiled with Expat >= 2.7.2")
class MemoryProtectionTest(AttackProtectionTestBase, unittest.TestCase):

# NOTE: with the default Expat configuration, the billion laughs protection
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
When Python was compiled with system expat older then 2.7.2 but tests run
with newer expat, still skip
:class:`!test.test_pyexpat.MemoryProtectionTest`.
5 changes: 5 additions & 0 deletions Modules/_functoolsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
PyObject *item;
PyObject *tot_args = PyTuple_New(tot_nargs);
if (tot_args == NULL) {
Py_DECREF(new_args);
Py_DECREF(pto);
return NULL;
}
for (Py_ssize_t i = 0, j = 0; i < tot_nargs; i++) {
if (i < npargs) {
item = PyTuple_GET_ITEM(pto_args, i);
Expand Down
3 changes: 2 additions & 1 deletion Modules/timemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,8 @@ time_tzset(PyObject *self, PyObject *unused)

/* Reset timezone, altzone, daylight and tzname */
if (init_timezone(m) < 0) {
return NULL;
Py_DECREF(m);
return NULL;
}
Py_DECREF(m);
if (PyErr_Occurred())
Expand Down
2 changes: 1 addition & 1 deletion Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)

exceptions = PySequence_Tuple(exceptions);
if (!exceptions) {
return NULL;
goto error;
}

/* We are now holding a ref to the exceptions tuple */
Expand Down
Loading