Avoid sprintf buffer overflow if more than 9999 arguments.

This commit is contained in:
Guido van Rossum 1997-04-30 19:00:27 +00:00
parent 04bc9d6e67
commit 15e33a4c42
1 changed files with 1 additions and 1 deletions

View File

@ -658,7 +658,7 @@ builtin_map(self, args)
if (! (sqp->sqf = sqp->seq->ob_type->tp_as_sequence)) {
static char errmsg[] =
"argument %d to map() must be a sequence object";
char errbuf[sizeof(errmsg) + 3];
char errbuf[sizeof(errmsg) + 25];
sprintf(errbuf, errmsg, i+2);
PyErr_SetString(PyExc_TypeError, errbuf);