Skip to content

Commit 3b11234

Browse files
author
Alexey Izbyshev
committed
[2.7] bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (pythonGH-8852)
Reported by Svace static analyzer.. (cherry picked from commit 28853a2) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent 830daae commit 3b11234

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Python/ast.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
25202520
break;
25212521
case STAR:
25222522
str = PyString_InternFromString("*");
2523+
if (!str)
2524+
return NULL;
25232525
PyArena_AddPyObject(c->c_arena, str);
25242526
return alias(str, NULL, c->c_arena);
25252527
default:

0 commit comments

Comments
 (0)