Kaydet (Commit) 4a0144c0 authored tarafından Guido van Rossum's avatar Guido van Rossum

Should check that PyObject_Str() really returned a string!

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