Commit 19294074 authored by Victor Stinner's avatar Victor Stinner

Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failed

This error cannot occur in practice: PyUnicode_FromObject() always return
a "ready" string.
parent eb0314f5
...@@ -13442,8 +13442,10 @@ PyUnicode_Format(PyObject *format, PyObject *args) ...@@ -13442,8 +13442,10 @@ PyUnicode_Format(PyObject *format, PyObject *args)
uformat = PyUnicode_FromObject(format); uformat = PyUnicode_FromObject(format);
if (uformat == NULL) if (uformat == NULL)
return NULL; return NULL;
if (PyUnicode_READY(uformat) == -1) if (PyUnicode_READY(uformat) == -1) {
Py_DECREF(uformat); Py_DECREF(uformat);
return NULL;
}
fmt = PyUnicode_DATA(uformat); fmt = PyUnicode_DATA(uformat);
fmtkind = PyUnicode_KIND(uformat); fmtkind = PyUnicode_KIND(uformat);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment