Commit 4b4ab20f authored by Barry Warsaw's avatar Barry Warsaw

ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer

overrun avoidance.
parent 857bf52d
...@@ -85,10 +85,11 @@ ste_repr(PySymtableEntryObject *ste) ...@@ -85,10 +85,11 @@ ste_repr(PySymtableEntryObject *ste)
{ {
char buf[256]; char buf[256];
sprintf(buf, "<symtable entry %.100s(%ld), line %d>", PyOS_snprintf(buf, sizeof(buf),
PyString_AS_STRING(ste->ste_name), "<symtable entry %.100s(%ld), line %d>",
PyInt_AS_LONG(ste->ste_id), PyString_AS_STRING(ste->ste_name),
ste->ste_lineno); PyInt_AS_LONG(ste->ste_id),
ste->ste_lineno);
return PyString_FromString(buf); return PyString_FromString(buf);
} }
......
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