summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-08-09 07:03:22 (GMT)
committerGeorg Brandl <georg@python.org>2006-08-09 07:03:22 (GMT)
commit209307eb3bca9aeb9b842014edcfe8df9cbb7f91 (patch)
treec5cd1f4876045284dcbf4144d591602c31b59650 /Python
parent8e24a9678f497ef40b01040d29ff260337da1e77 (diff)
downloadcpython-209307eb3bca9aeb9b842014edcfe8df9cbb7f91.zip
cpython-209307eb3bca9aeb9b842014edcfe8df9cbb7f91.tar.gz
cpython-209307eb3bca9aeb9b842014edcfe8df9cbb7f91.tar.bz2
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
Diffstat (limited to 'Python')
-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)