From: Georg Brandl Date: Wed, 9 Aug 2006 07:03:22 +0000 (+0000) Subject: Introduce an upper bound on tuple nesting depth in X-Git-Tag: v2.5c1~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=209307eb3bca9aeb9b842014edcfe8df9cbb7f91;p=python Introduce an upper bound on tuple nesting depth in C argument format strings; fixes rest of #1523610. --- diff --git a/Python/getargs.c b/Python/getargs.c index 508055e690..3fca9cdfce 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -206,6 +206,9 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags) if (level == 0) max++; level++; + if (level >= 30) + Py_FatalError("too many tuple nesting levels " + "in argument format string"); break; case ')': if (level == 0)