]> granicus.if.org Git - python/commitdiff
Avoid sprintf buffer overflow if more than 9999 arguments.
authorGuido van Rossum <guido@python.org>
Wed, 30 Apr 1997 19:00:27 +0000 (19:00 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 30 Apr 1997 19:00:27 +0000 (19:00 +0000)
Python/bltinmodule.c

index 3fdaac9736f5eda112afdef617bae6541ca46fbd..fd8dc803cf55d176ef531eab95848bb0a1c9282f 100644 (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);