Kaydet (Commit) 312af42b authored tarafından Barry Warsaw's avatar Barry Warsaw

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

overrun avoidance.
üst 6197509f
...@@ -102,7 +102,8 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -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);
......
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