Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 312af42

Browse files
committed
structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer
overrun avoidance.
1 parent 6197509 commit 312af42

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/structseq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ structseq_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
102102
len = PySequence_Length(arg);
103103
required_len = REAL_SIZE_TP(type);
104104
if (len != required_len) {
105-
sprintf(msgbuf,
105+
PyOS_snprintf(
106+
msgbuf, sizeof(msgbuf),
106107
"constructor takes exactly %d arguments (%d given)",
107108
required_len,
108109
len);

0 commit comments

Comments
 (0)