classification
Title: tokenizer.c does not handle new_string() failure
Type: Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, python-dev, vstinner
Priority: normal Keywords:

Created on 2013-07-16 01:32 by vstinner, last changed 2013-07-16 03:47 by python-dev. This issue is now closed.

Messages (4)
msg193143 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-07-16 01:32
Callers of the new_string() function do not check if the function succeed or not. Python does crash if the function failed, for example in get_coding_spec():

                char* r = new_string(begin, t - begin);
                char* q = get_normal_name(r);

Using pytracemalloc tool, it's easy to tricker this issue (ex: using test_future or test_parser): see issue #18408.
msg193149 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-16 02:17
New changeset c3a510b22218 by Benjamin Peterson in branch '3.3':
check the return value of new_string() (closes #18470)
http://hg.python.org/cpython/rev/c3a510b22218

New changeset 8889c9b5dd3a by Benjamin Peterson in branch '3.3':
merge 3.3 (#18470)
http://hg.python.org/cpython/rev/8889c9b5dd3a
msg193150 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-07-16 02:41
The fix has not been merged into default.
msg193152 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-07-16 03:47
New changeset 2650127ce034 by Benjamin Peterson in branch 'default':
merge 3.3 (closes #18470)
http://hg.python.org/cpython/rev/2650127ce034
History
Date User Action Args
2013-07-16 03:47:54python-devsetstatus: open -> closed
resolution: fixed
messages: + msg193152
2013-07-16 02:41:48vstinnersetstatus: closed -> open
resolution: fixed -> (no value)
messages: + msg193150
2013-07-16 02:17:27python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg193149

resolution: fixed
stage: resolved
2013-07-16 01:36:05vstinnersetnosy: + benjamin.peterson
2013-07-16 01:32:23vstinnercreate