From 312af42b47ad32ad8935b5706a890865a4f34d40 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 28 Nov 2001 20:56:44 +0000 Subject: [PATCH] structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. --- Objects/structseq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/structseq.c b/Objects/structseq.c index 7ad607b0e39..2ab9b52055b 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -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);