Commit 4a0144c0 authored by Guido van Rossum's avatar Guido van Rossum

Should check that PyObject_Str() really returned a string!

parent fe02efdb
......@@ -900,6 +900,11 @@ PyString_Format(format, args)
temp = PyObject_Str(v);
if (temp == NULL)
goto error;
if (!PyString_Check(temp)) {
PyErr_SetString(PyExc_TypeError,
"%s argument has non-string str()");
goto error;
}
buf = PyString_AsString(temp);
len = PyString_Size(temp);
if (prec >= 0 && len > prec)
......
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