From: Guido van Rossum Date: Wed, 30 Apr 1997 19:00:27 +0000 (+0000) Subject: Avoid sprintf buffer overflow if more than 9999 arguments. X-Git-Tag: v1.5a1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15e33a4c42c9afacbe93eb4e3102a5e068e292eb;p=python Avoid sprintf buffer overflow if more than 9999 arguments. --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 3fdaac9736..fd8dc803cf 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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);