diff --git a/client/src/preferences.c b/client/src/preferences.c index b133dd428..92a91e54a 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -834,7 +834,7 @@ static int setCmdSavePaths(const char *Cmd) { CLIParserFree(ctx); if (deflen == 0 && dulen == 0 && tlen == 0) { - PrintAndLogEx(FAILED, "Must give atleast one path"); + PrintAndLogEx(FAILED, "Must give at least one path"); return PM3_EINVARG; } @@ -853,6 +853,11 @@ static int setCmdSavePaths(const char *Cmd) { path = trace_path; } + if (path == NULL) { + PrintAndLogEx(FAILED, "Must give at least one path"); + return PM3_EINVARG; + } + // remove trailing slash. size_t nplen = strlen(path); if ((path[nplen - 1] == '/') || (path[nplen - 1] == '\\')) {