Skip to content
Snippets Groups Projects
Commit 4faa177f authored by Kaspar Mösinger's avatar Kaspar Mösinger
Browse files

Fix: If the arguments 'naok' or 'verbose' are not given, the C code will likely crash.

parent 387681fe
No related branches found
No related tags found
No related merge requests found
......@@ -119,13 +119,13 @@ SEXP dC64(SEXP args_in) {
// We don't need to PROTECT args and args_names, because they are protected by being a subobject of args_in.
// Check the NAOK argument
if(LENGTH(naok) != 1)
if(!naok || LENGTH(naok) != 1)
error(_("argument 'NAOK' has to be of length 1 (dotCall64)"));
flag_naok = asInteger(naok);
// Check the VERBOSE argument
if(LENGTH(verbose) != 1)
if(!verbose || LENGTH(verbose) != 1)
error(_("argument 'VERBOSE' has to be of length 1 (dotCall64)"));
flag_verbose = asInteger(verbose);
if(!(flag_verbose == 0 || flag_verbose == 1 || flag_verbose == 2))
......@@ -556,6 +556,8 @@ static void argsfind(SEXP args_in, SEXP *args, SEXP *names,int *len, char *packa
strcpy(packageName, "");
*signature = NULL;
*intent = NULL;
*naok = NULL;
*verbose = NULL;
for(s = args_in; s != R_NilValue;) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment