Merge pull request #14326 from s-hadinger/fix_berry_arg_crash

Berry fix crash when superfluous parameter is sent
This commit is contained in:
s-hadinger 2022-01-08 11:11:02 +01:00 committed by GitHub
commit 3217efaace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,7 @@ int be_check_arg_type(bvm *vm, int arg_start, int argc, const char * arg_type, i
arg_type = NULL; // stop iterations
break;
}
if (arg_type[arg_idx] == '[' || arg_type[arg_idx] == ']') { // '[' is a marker that following parameters are optional and default to NULL
if (arg_type && (arg_type[arg_idx] == '[' || arg_type[arg_idx] == ']')) { // '[' is a marker that following parameters are optional and default to NULL
arg_optional = btrue;
arg_idx++;
}