Skip to content

Commit 0ef61ee

Browse files
miss-islingtonAlexey Izbyshev
andauthored
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 28853a2) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent b14a68f commit 0ef61ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,6 +3267,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
32673267
break;
32683268
case STAR:
32693269
str = PyUnicode_InternFromString("*");
3270+
if (!str)
3271+
return NULL;
32703272
if (PyArena_AddPyObject(c->c_arena, str) < 0) {
32713273
Py_DECREF(str);
32723274
return NULL;

0 commit comments

Comments
 (0)