diff options
author | Alexey Izbyshev <izbyshev@ispras.ru> | 2018-08-22 11:46:51 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-08-22 11:46:51 (GMT) |
commit | 5223ce2131a121201a78d0680302ea06c4a58369 (patch) | |
tree | 2d611aaeb52aceeef24c60cb7a76363bd23e1088 /Python/ast.c | |
parent | eb9a1c01d07309006ef5544da62ba813685bd098 (diff) | |
download | cpython-5223ce2131a121201a78d0680302ea06c4a58369.zip cpython-5223ce2131a121201a78d0680302ea06c4a58369.tar.gz cpython-5223ce2131a121201a78d0680302ea06c4a58369.tar.bz2 |
[2.7] bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852) (GH-8858)
Reported by Svace static analyzer.
(cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Diffstat (limited to 'Python/ast.c')
-rw-r--r-- | Python/ast.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index 318c0bb..9460325 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -2520,6 +2520,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store) break; case STAR: str = PyString_InternFromString("*"); + if (!str) + return NULL; PyArena_AddPyObject(c->c_arena, str); return alias(str, NULL, c->c_arena); default: |