summaryrefslogtreecommitdiff
path: root/src/or/ntmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/ntmain.c')
-rw-r--r--src/or/ntmain.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/ntmain.c b/src/or/ntmain.c
index 01244c4c08..d001f7be13 100644
--- a/src/or/ntmain.c
+++ b/src/or/ntmain.c
@@ -455,7 +455,7 @@ static char *
nt_service_command_line(int *using_default_torrc)
{
TCHAR tor_exe[MAX_PATH+1];
- char tor_exe_ascii[MAX_PATH+1];
+ char tor_exe_ascii[MAX_PATH*2+1];
char *command=NULL, *options=NULL;
smartlist_t *sl;
int i;
@@ -483,6 +483,7 @@ nt_service_command_line(int *using_default_torrc)
#ifdef UNICODE
wcstombs(tor_exe_ascii, tor_exe, sizeof(tor_exe_ascii));
+ tor_exe_ascii[sizeof(tor_exe_ascii)-1] = '\0';
#else
strlcpy(tor_exe_ascii, tor_exe, sizeof(tor_exe_ascii));
#endif