X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/e88c04f924abb31589f9f58691fcf94238fead63..968cb35498c6d6331a4c65b1f23dad2bbeb79f6f:/client/cmdscript.c

diff --git a/client/cmdscript.c b/client/cmdscript.c
index 23163aa9..0d19f496 100644
--- a/client/cmdscript.c
+++ b/client/cmdscript.c
@@ -76,8 +76,11 @@ int CmdList(const char *Cmd)
 {
     DIR *dp;
     struct dirent *ep;
-	char script_directory_path[strlen(get_my_executable_directory()) + strlen(LUA_SCRIPTS_DIRECTORY) + 1];
-	strcpy(script_directory_path, get_my_executable_directory());
+	char const * exedir = 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);
 	strcat(script_directory_path, LUA_SCRIPTS_DIRECTORY);
     dp = opendir(script_directory_path);