Commit 70c94e78 authored by Christian Heimes's avatar Christian Heimes

Issue #18552: Check return value of PyArena_AddPyObject() in obj2ast_object().

parent 1acc129d
......@@ -12,6 +12,9 @@ What's New in Python 3.3.3 release candidate 1?
Core and Builtins
-----------------
- Issue #18552: Check return value of PyArena_AddPyObject() in
obj2ast_object().
- Issue #18560: Fix potential NULL pointer dereference in sum().
- Issue #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
......
......@@ -834,9 +834,13 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
{
if (obj == Py_None)
obj = NULL;
if (obj)
PyArena_AddPyObject(arena, obj);
Py_XINCREF(obj);
if (obj) {
if (PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL;
return -1;
}
Py_INCREF(obj);
}
*out = obj;
return 0;
}
......
......@@ -688,9 +688,13 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
{
if (obj == Py_None)
obj = NULL;
if (obj)
PyArena_AddPyObject(arena, obj);
Py_XINCREF(obj);
if (obj) {
if (PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL;
return -1;
}
Py_INCREF(obj);
}
*out = obj;
return 0;
}
......
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