From 79ed9c3887475677687e7c65d90c6138ea305f3c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 13 Dec 2017 19:38:07 +0100 Subject: [PATCH] fix: for netbsd ppl, executable dir could be null, (@khorben) https://github.com/DeforaNetworks/proxmark3/commit/8e51b68e8362f281b9292c5899e5c4f38c206701 --- client/cmdscript.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/cmdscript.c b/client/cmdscript.c index 9aa37bda7..c5e964255 100644 --- a/client/cmdscript.c +++ b/client/cmdscript.c @@ -69,7 +69,12 @@ bool endsWith (char* base, char* str) { */ int CmdScriptList(const char *Cmd) { - char script_directory_path[strlen(get_my_executable_directory()) + strlen(LUA_SCRIPTS_DIRECTORY) + 1]; + char const * exedir = get_my_executable_directory(); + strcpy(script_directory_path, get_my_executable_directory()); + if (exedir == NULL) + return 0; + char script_directory_path[strlen(exedir) + strlen(LUA_SCRIPTS_DIRECTORY) + 1]; + strcpy(script_directory_path, exedir); strcpy(script_directory_path, get_my_executable_directory()); strcat(script_directory_path, LUA_SCRIPTS_DIRECTORY);