mirror of https://github.com/python/cpython.git
ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
This commit is contained in:
parent
857bf52d56
commit
4b4ab20f2c
|
@ -85,10 +85,11 @@ ste_repr(PySymtableEntryObject *ste)
|
|||
{
|
||||
char buf[256];
|
||||
|
||||
sprintf(buf, "<symtable entry %.100s(%ld), line %d>",
|
||||
PyString_AS_STRING(ste->ste_name),
|
||||
PyInt_AS_LONG(ste->ste_id),
|
||||
ste->ste_lineno);
|
||||
PyOS_snprintf(buf, sizeof(buf),
|
||||
"<symtable entry %.100s(%ld), line %d>",
|
||||
PyString_AS_STRING(ste->ste_name),
|
||||
PyInt_AS_LONG(ste->ste_id),
|
||||
ste->ste_lineno);
|
||||
return PyString_FromString(buf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue