[issue4467] return value of PyUnicode_AsEncodedString() is not checked for NULL

Brian Szuter report at bugs.python.org
Sat Nov 29 18:59:47 CET 2008


New submission from Brian Szuter <Brian.Szuter at gmail.com>:

Python-2.5.2/Objects/unicodeobject.c(unicode_str)
Line 6816

The return value of PyUnicode_AsEncodedString() is not checked for NULL.

According to
http://www.python.org/doc/2.5.2/api/builtinCodecs.html#l2h-519 this
indicates an exception occurred.

See the following for instances of where this value is checked:
Parser/tokenizer.c(tok_stdin_decode) 726
Parser/tokenizer.c(dec_utf8) 1555
Objects/object.c(PyObject_GenericSetAttr) 1386
Objects/object.c(PyObject_GenericGetAttr) 1260
Objects/object.c(PyObject_SetAttr) 1161
Objects/object.c(PyObject_Str) 434-437
Objects/stringobject.c(PyString_AsEncodedString) 501
Objects/stringobject.c(PyString_AsDecodedString) 421
Objects/unicodeobject.c(_PyUnicodeUCS2_AsDefaultEncodedString) 735

----------
components: None
messages: 76614
nosy: CWRU_Researcher1
severity: normal
status: open
title: return value of PyUnicode_AsEncodedString() is not checked for NULL
type: performance
versions: Python 2.5.3

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


More information about the Python-bugs-list mailing list