From: Barry Warsaw Date: Wed, 28 Nov 2001 21:36:28 +0000 (+0000) Subject: ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer X-Git-Tag: v2.2.1c1~662 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b4ab20f2c07a0e555c0b982089448b5471f6521;p=thirdparty%2FPython%2Fcpython.git ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. --- diff --git a/Python/symtable.c b/Python/symtable.c index 4f63ae798f02..080bfd5aa335 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -85,10 +85,11 @@ ste_repr(PySymtableEntryObject *ste) { char buf[256]; - sprintf(buf, "", - PyString_AS_STRING(ste->ste_name), - PyInt_AS_LONG(ste->ste_id), - ste->ste_lineno); + PyOS_snprintf(buf, sizeof(buf), + "", + PyString_AS_STRING(ste->ste_name), + PyInt_AS_LONG(ste->ste_id), + ste->ste_lineno); return PyString_FromString(buf); }