mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
p->locals may be NULL when error occurs before the point.
This is reported by oss-fuzz: Issue 19886: mruby:mruby_fuzzer: Potential-null-reference in setup_numparams
This commit is contained in:
@@ -845,7 +845,8 @@ setup_numparams(parser_state *p, node *a)
|
||||
if (a && (a->car || (a->cdr && a->cdr->car) || (a->cdr->cdr && a->cdr->cdr->car) || (a->cdr->cdr->cdr->cdr && a->cdr->cdr->cdr->cdr->car))) {
|
||||
yyerror(p, "ordinary parameter is defined");
|
||||
}
|
||||
else {
|
||||
else if (p->locals) {
|
||||
/* p->locals should not be NULL unless error happens before the point */
|
||||
node* args = 0;
|
||||
for (i = nvars; i > 0; i--) {
|
||||
char buf[3];
|
||||
|
||||
Reference in New Issue
Block a user