classification
Title: builtin_sum() doesn't check return value of PyLong_FromLong()
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, haypo, python-dev
Priority: normal Keywords: patch

Created on 2013-07-26 14:52 by christian.heimes, last changed 2013-07-26 20:52 by christian.heimes. This issue is now closed.

Files
File name Uploaded Description Edit
builtin_sum.patch christian.heimes, 2013-07-26 14:52
Messages (4)
msg193730 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-26 14:52
2032            result = PyLong_FromLong(i_result);
CID 1058287 (#1 of 1): Dereference null return value (NULL_RETURNS)
34. dereference: Dereferencing a pointer that might be null "result" when calling "PyNumber_Add(PyObject *, PyObject *)". [show details]
2033            temp = PyNumber_Add(result, item);
msg193746 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2013-07-26 20:47
The patch looks good to me.
msg193748 - (view) Author: Roundup Robot (python-dev) Date: 2013-07-26 20:50
New changeset de7e4fd634fb by Christian Heimes in branch '3.3':
Issue #18560: Fix potential NULL pointer dereference in sum()
http://hg.python.org/cpython/rev/de7e4fd634fb

New changeset a5d9e2f3f6c7 by Christian Heimes in branch 'default':
Issue #18560: Fix potential NULL pointer dereference in sum()
http://hg.python.org/cpython/rev/a5d9e2f3f6c7
msg193750 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-07-26 20:52
Thanks again!
History
Date User Action Args
2013-07-26 20:52:05christian.heimessetstatus: open -> closed
resolution: fixed
messages: + msg193750

stage: patch review -> resolved
2013-07-26 20:50:10python-devsetnosy: + python-dev
messages: + msg193748
2013-07-26 20:47:59hayposetnosy: + haypo
messages: + msg193746
2013-07-26 14:52:26christian.heimescreate