aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-06-11 10:14:01 -0400
committerNick Mathewson <nickm@torproject.org>2012-06-11 10:14:01 -0400
commita6180b7f290c52b03f8abe3caf2ce233399dd66f (patch)
tree03e84ecf4e9f0b7cc401b3033f34197198cd8c84 /src/or/config.c
parentcb01aaea12b5ed217a1af2595aa9d658c4a52709 (diff)
parentbf9252587b4d7d970f02631b308451fb05ec5560 (diff)
downloadtor-a6180b7f290c52b03f8abe3caf2ce233399dd66f.tar.gz
tor-a6180b7f290c52b03f8abe3caf2ce233399dd66f.zip
Merge branch 'bug6097'
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 090d96c155..2e3ce6429d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4302,7 +4302,7 @@ static char *
get_windows_conf_root(void)
{
static int is_set = 0;
- static char path[MAX_PATH+1];
+ static char path[MAX_PATH*2+1];
TCHAR tpath[MAX_PATH] = {0};
LPITEMIDLIST idl;
@@ -4332,7 +4332,8 @@ get_windows_conf_root(void)
/* Convert the path from an "ID List" (whatever that is!) to a path. */
result = SHGetPathFromIDList(idl, tpath);
#ifdef UNICODE
- wcstombs(path,tpath,MAX_PATH);
+ wcstombs(path,tpath,sizeof(path));
+ path[sizeof(path)-1] = '\0';
#else
strlcpy(path,tpath,sizeof(path));
#endif