diff --git a/client/src/preferences.c b/client/src/preferences.c index 41b8fc1a6..ccdcd249f 100644 --- a/client/src/preferences.c +++ b/client/src/preferences.c @@ -437,17 +437,19 @@ static void showSavePathState(savePaths_t path_index, prefShowOpt_t opt) { strcpy(s, _RED_("unknown")" save path......"); } - if ((session.defaultPaths[path_index] == NULL) || (strcmp(session.defaultPaths[path_index], "") == 0)) { - PrintAndLogEx(INFO, " %s %s "_WHITE_("not set"), - prefShowMsg(opt), - s - ); - } else { - PrintAndLogEx(INFO, " %s %s "_GREEN_("%s"), - prefShowMsg(opt), - s, - session.defaultPaths[path_index] - ); + if (path_index < spItemCount) { + if ((session.defaultPaths[path_index] == NULL) || (strcmp(session.defaultPaths[path_index], "") == 0)) { + PrintAndLogEx(INFO, " %s %s "_WHITE_("not set"), + prefShowMsg(opt), + s + ); + } else { + PrintAndLogEx(INFO, " %s %s "_GREEN_("%s"), + prefShowMsg(opt), + s, + session.defaultPaths[path_index] + ); + } } }