[issue11032] _string: formatter_field_name_split() and formatter_parser doesn't check input type

STINNER Victor report at bugs.python.org
Fri Jan 28 00:07:56 CET 2011


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

$ ./python 
Python 3.2rc1+ (unknown, Jan 18 2011, 00:55:20) 
>>> import _string
>>> _string.formatter_field_name_split(1)
python: Objects/stringlib/string_format.h:1347: formatter_field_name_split: Assertion `((((((PyObject*)(self))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed.
Abandon

$ ./python 
Python 3.2rc1+ (unknown, Jan 18 2011, 00:55:20) 
>>> import _string
>>> _string.formatter_parser(1)
python: Objects/stringlib/string_format.h:1206: formatter_parser: Assertion `((((((PyObject*)(self))->ob_type))->tp_flags & ((1L<<28))) != 0)' failed.
Abandon

Attached patch fixes both crashes and add tests on the _string module (which has only these two functions).

----------
components: Library (Lib)
files: _string.patch
keywords: patch
messages: 127236
nosy: haypo
priority: normal
severity: normal
status: open
title: _string: formatter_field_name_split() and formatter_parser doesn't check input type
versions: Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file20562/_string.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11032>
_______________________________________


More information about the Python-bugs-list mailing list