mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
This commit is contained in:
parent
6197509f24
commit
312af42b47
1 changed files with 2 additions and 1 deletions
|
@ -102,7 +102,8 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
len = PySequence_Length(arg);
|
len = PySequence_Length(arg);
|
||||||
required_len = REAL_SIZE_TP(type);
|
required_len = REAL_SIZE_TP(type);
|
||||||
if (len != required_len) {
|
if (len != required_len) {
|
||||||
sprintf(msgbuf,
|
PyOS_snprintf(
|
||||||
|
msgbuf, sizeof(msgbuf),
|
||||||
"constructor takes exactly %d arguments (%d given)",
|
"constructor takes exactly %d arguments (%d given)",
|
||||||
required_len,
|
required_len,
|
||||||
len);
|
len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue