From: Guido van Rossum Date: Mon, 28 Jan 2019 19:33:28 +0000 (-0800) Subject: Check for errors from _Py_asdl_seq_new() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4abedd3f9f46309ca9ff51189548daefc2e37e66;p=thirdparty%2FPython%2Fcpython.git Check for errors from _Py_asdl_seq_new() --- diff --git a/Python/ast.c b/Python/ast.c index 4d59344a4aa4..cad82d1d5827 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -894,6 +894,8 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, } argtypes = _Py_asdl_seq_new(num, arena); + if (!argtypes) + goto out; j = 0; for (i = 0; i < NCH(ch); i++) { @@ -905,8 +907,11 @@ PyAST_FromNodeObject(const node *n, PyCompilerFlags *flags, } } } - else + else { argtypes = _Py_asdl_seq_new(0, arena); + if (!argtypes) + goto out; + } ret = ast_for_expr(&c, CHILD(n, NCH(n) - 1)); if (!ret)