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

overrun avoidance.
This commit is contained in:
Barry Warsaw 2001-11-28 20:56:44 +00:00
parent 6197509f24
commit 312af42b47
1 changed files with 2 additions and 1 deletions

View File

@ -102,7 +102,8 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
len = PySequence_Length(arg);
required_len = REAL_SIZE_TP(type);
if (len != required_len) {
sprintf(msgbuf,
PyOS_snprintf(
msgbuf, sizeof(msgbuf),
"constructor takes exactly %d arguments (%d given)",
required_len,
len);