]> granicus.if.org Git - python/commitdiff
Introduce an upper bound on tuple nesting depth in
authorGeorg Brandl <georg@python.org>
Wed, 9 Aug 2006 07:03:22 +0000 (07:03 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 9 Aug 2006 07:03:22 +0000 (07:03 +0000)
C argument format strings; fixes rest of #1523610.

Python/getargs.c

index 508055e6905bccce832f01d5e5b6664b5c939ed0..3fca9cdfce358e3f3c6c2076ee5d4f1e34e53983 100644 (file)
@@ -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)