Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Null terminate the bracketsDirPath (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
boopeshmahendran authored and nethip committed Sep 11, 2017
1 parent f83b907 commit 7173fd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions appshell/appshell_node_process_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ void* nodeThread(void* unused) {
// strip off trailing executable name
char* lastIndexOf = strrchr(executablePath, '/');
memcpy(bracketsDirPath, executablePath, lastIndexOf - executablePath + 1);

// null terminate the string
bracketsDirPath[lastIndexOf - executablePath + 1] = '\0';

// create node exec and node-core paths
strcpy(nodeExecutablePath, bracketsDirPath);
Expand Down

0 comments on commit 7173fd2

Please sign in to comment.