Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8207cc7

Browse files
committed
Quote the path to the executable before invoking system().
1 parent 3150a27 commit 8207cc7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

PCbuild/make_buildinfo.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ int make_buildinfo2()
3131
RegOpenKey(HKEY_CURRENT_USER, "Software\\TortoiseSVN", &hTortoise) != ERROR_SUCCESS)
3232
/* Tortoise not installed */
3333
return 0;
34-
size = sizeof(command);
35-
if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command, &size) != ERROR_SUCCESS ||
34+
command[0] = '"'; /* quote the path to the executable */
35+
size = sizeof(command) - 1;
36+
if (RegQueryValueEx(hTortoise, "Directory", 0, &type, command+1, &size) != ERROR_SUCCESS ||
3637
type != REG_SZ)
3738
/* Registry corrupted */
3839
return 0;
39-
strcat(command, "bin\\subwcrev.exe");
40+
strcat(command, "bin\\subwcrev.exe\"");
4041
if (_stat(command, &st) < 0)
4142
/* subwcrev.exe not part of the release */
4243
return 0;

0 commit comments

Comments
 (0)