This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: parameters of PyLong_FromString() are not checked for NULL
Type: Stage: patch review
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: CWRU_Researcher1, mark.dickinson, rhettinger
Priority: low Keywords: patch

Created on 2008-11-29 16:54 by CWRU_Researcher1, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
parsenumber.diff rhettinger, 2008-11-29 18:33 Add assertion to internal function
Messages (5)
msg76602 - (view) Author: Brian Szuter (CWRU_Researcher1) Date: 2008-11-29 16:54
Python-2.5.2/Python/ast.c(parsenumber)
Line 3061

The parameters of PyLong_FromString() are not checked for NULL before
the method is called.
msg76620 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2008-11-29 18:33
This is an internal call, so am not worried about "const char *s" being
NULL -- that duty belongs to the caller who creates the pointer in the
first place.  That being said, it wouldn't hurt to add an assertion at
the beginning of the function.
msg76621 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-11-29 18:44
Patch looks fine. (!)
Okay just to apply this to 2.6 and up?  It's not a bugfix.
msg77060 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-12-05 19:31
All tests pass with this patch.

Committed to trunk, r67590.  Will merge to 2.7, 3.0 and 3.1.
msg77066 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2008-12-05 20:54
Merged.

Thanks for the report, Brian.
History
Date User Action Args
2022-04-11 14:56:41adminsetgithub: 48711
2008-12-05 20:54:36mark.dickinsonsetstatus: open -> closed
resolution: fixed
messages: + msg77066
2008-12-05 19:32:29mark.dickinsonsetversions: - Python 2.6, Python 2.7
2008-12-05 19:31:31mark.dickinsonsetmessages: + msg77060
2008-11-29 18:44:28mark.dickinsonsetmessages: + msg76621
versions: - Python 2.5.3
2008-11-29 18:33:56rhettingersetfiles: + parsenumber.diff
priority: low
type: resource usage ->
assignee: mark.dickinson
components: + Interpreter Core, - None
versions: + Python 2.6, Python 3.0, Python 2.7
keywords: + patch
nosy: + rhettinger, mark.dickinson
messages: + msg76620
stage: patch review
2008-11-29 16:54:38CWRU_Researcher1create