mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
Avoid a crash in "script list" (#521)
This command crashes if the path to the executable directory could not be found.
This commit is contained in:
parent
91e03840f4
commit
0f112d6f19
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue