[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

STINNER Victor report at bugs.python.org
Sat Aug 15 00:39:33 CEST 2009


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

The error occurs in Py_Main(), on _PyUnicode_AsString(commandObj). The
problem is that _PyUnicode_AsString() is not checked for error. Here is
a patch fixing two errors:
 - display on error message instead of a crash on
_PyUnicode_AsString(commandObj) failure
 - don't call Py_DECREF(commandObj) if commandObj is NULL
(PyUnicode_FromWideChar error, a different error)

My patch also includes a test. The test should be moved somewhere else,
but I don't know where.

----------
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file14730/pymain.patch

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


More information about the Python-bugs-list mailing list