summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-11-28 21:36:28 (GMT)
committerBarry Warsaw <barry@python.org>2001-11-28 21:36:28 (GMT)
commit4b4ab20f2c07a0e555c0b982089448b5471f6521 (patch)
tree176af8d2e49bd842ba4fc136d6c839ca9e42bf14
parent857bf52d56e1508be783d7f7e11a9d6783aadb20 (diff)
downloadcpython-4b4ab20f2c07a0e555c0b982089448b5471f6521.zip
cpython-4b4ab20f2c07a0e555c0b982089448b5471f6521.tar.gz
cpython-4b4ab20f2c07a0e555c0b982089448b5471f6521.tar.bz2
ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
-rw-r--r--Python/symtable.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 4f63ae7..080bfd5 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -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);
}