-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
Description
The pointer s->v.AsyncFunctionDef.args->kw_defaults is explicitly checked for NULL:
Lines 2193 to 2195 in aaad2e8
if (s->v.AsyncFunctionDef.args->kw_defaults) | |
VISIT_SEQ_WITH_NULL(st, expr, | |
s->v.AsyncFunctionDef.args->kw_defaults); |
However, a few lines later, the same pointer is passed unconditionally to the has_kwonlydefaults function:
Lines 2203 to 2204 in aaad2e8
has_kwonlydefaults(s->v.AsyncFunctionDef.args->kwonlyargs, | |
s->v.AsyncFunctionDef.args->kw_defaults), |
Inside has_kwonlydefaults, the kw_defaults parameter is not checked for NULL before being dereferenced:
Lines 1783 to 1787 in aaad2e8
for (int i = 0; i < asdl_seq_LEN(kwonlyargs); i++) { | |
expr_ty default_ = asdl_seq_GET(kw_defaults, i); | |
if (default_) { | |
return 1; | |
} |
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided