File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
1010Core and Builtins
1111-----------------
1212
13+ - Issue #18560: Fix potential NULL pointer dereference in sum().
14+
1315- Issue #18520: Add a new PyStructSequence_InitType2() function, same than
1416 PyStructSequence_InitType() except that it has a return value (0 on success,
1517 -1 on error).
Original file line number Diff line number Diff line change @@ -2030,6 +2030,11 @@ builtin_sum(PyObject *self, PyObject *args)
20302030 }
20312031 /* Either overflowed or is not an int. Restore real objects and process normally */
20322032 result = PyLong_FromLong (i_result );
2033+ if (result == NULL ) {
2034+ Py_DECREF (item );
2035+ Py_DECREF (iter );
2036+ return NULL ;
2037+ }
20332038 temp = PyNumber_Add (result , item );
20342039 Py_DECREF (result );
20352040 Py_DECREF (item );
You can’t perform that action at this time.
0 commit comments