diff Python/getargs.c @ 39408:9d089aa58e2f legacy-trunk

Introduce an upper bound on tuple nesting depth in C argument format strings; fixes rest of #1523610.
author Georg Brandl <georg@python.org>
date Wed, 09 Aug 2006 07:03:22 +0000
parents 17d5671fffcc
children 798935e1295e 936297047c17
line wrap: on
line diff
--- a/Python/getargs.c	Wed Aug 09 00:52:26 2006 +0000
+++ b/Python/getargs.c	Wed Aug 09 07:03:22 2006 +0000
@@ -206,6 +206,9 @@
 			if (level == 0)
 				max++;
 			level++;
+			if (level >= 30)
+				Py_FatalError("too many tuple nesting levels "
+					      "in argument format string");
 			break;
 		case ')':
 			if (level == 0)