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

Created on 2013-07-26 14:52 by christian.heimes, last changed 2018-08-24 05:31 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
builtin_sum.patch christian.heimes, 2013-07-26 14:52
Pull Requests
URL Status Linked Edit
PR 8892 merged benjamin.peterson, 2018-08-24 04:33
Messages (5)
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 (vstinner) * (Python committer) Date: 2013-07-26 20:47
The patch looks good to me.
msg193748 - (view) Author: Roundup Robot (python-dev) (Python triager) 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!
msg323993 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-08-24 05:31
Backported to 2.7 in 67dafd5c202cd529e209bf3f35e022ce766709eb. (I messed up the commit message.)
History
Date User Action Args
2018-08-24 05:31:37benjamin.petersonsetnosy: + benjamin.peterson

messages: + msg323993
versions: + Python 2.7
2018-08-24 04:33:13benjamin.petersonsetpull_requests: + pull_request8365
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:59vstinnersetnosy: + vstinner
messages: + msg193746
2013-07-26 14:52:26christian.heimescreate