summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/getargs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 508055e..3fca9cd 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)