mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Fix bug found by Coverity: don't allow NULL argument to PyUnicode_CheckExact
This commit is contained in:
parent
d364a07517
commit
3daf75878d
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue