From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 22 Aug 2018 05:54:46 +0000 (-0400) Subject: bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852) X-Git-Tag: v3.7.1rc1~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8e7319d39bf44355bf60f9bbec07cfbbe56739d;p=thirdparty%2FPython%2Fcpython.git bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852) Reported by Svace static analyzer. (cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446) Co-authored-by: Alexey Izbyshev --- diff --git a/Python/ast.c b/Python/ast.c index 6e1793dc3375..5001ad530c8d 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3252,6 +3252,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store) break; case STAR: str = PyUnicode_InternFromString("*"); + if (!str) + return NULL; if (PyArena_AddPyObject(c->c_arena, str) < 0) { Py_DECREF(str); return NULL;