diff Objects/structseq.c @ 21081:94f5a9fa3583 legacy-trunk

structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance.
author Barry Warsaw <barry@python.org>
date Wed, 28 Nov 2001 20:56:44 +0000
parents ab2e315849a7
children 1a5110b4bd72
line wrap: on
line diff
--- a/Objects/structseq.c	Wed Nov 28 20:55:34 2001 +0000
+++ b/Objects/structseq.c	Wed Nov 28 20:56:44 2001 +0000
@@ -102,7 +102,8 @@
 	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);