Skip to content

Commit b8e7319

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 <[email protected]>
1 parent 3152bc3 commit b8e7319

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
@@ -3252,6 +3252,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
32523252
break;
32533253
case STAR:
32543254
str = PyUnicode_InternFromString("*");
3255+
if (!str)
3256+
return NULL;
32553257
if (PyArena_AddPyObject(c->c_arena, str) < 0) {
32563258
Py_DECREF(str);
32573259
return NULL;

0 commit comments

Comments
 (0)