mirror of
https://github.com/python/cpython.git
synced 2024-11-27 20:04:41 +08:00
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
This commit is contained in:
parent
d364a07517
commit
3daf75878d
@ -402,9 +402,9 @@ PyObject_Unicode(PyObject *v)
|
||||
PyObject *func;
|
||||
static PyObject *unicodestr;
|
||||
|
||||
if (v == NULL)
|
||||
if (v == NULL) {
|
||||
res = PyString_FromString("<NULL>");
|
||||
if (PyUnicode_CheckExact(v)) {
|
||||
} else if (PyUnicode_CheckExact(v)) {
|
||||
Py_INCREF(v);
|
||||
return v;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user