Skip to content

Commit 209307e

Browse files
committed
Introduce an upper bound on tuple nesting depth in
C argument format strings; fixes rest of #1523610.
1 parent 8e24a96 commit 209307e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Python/getargs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
206206
if (level == 0)
207207
max++;
208208
level++;
209+
if (level >= 30)
210+
Py_FatalError("too many tuple nesting levels "
211+
"in argument format string");
209212
break;
210213
case ')':
211214
if (level == 0)

0 commit comments

Comments
 (0)