summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-04-16 23:35:38 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2012-04-16 23:35:38 +0200
commit2004bd1736d0a984c12b1d56156f5552816c80f4 (patch)
tree31f5eae2a9ef1a7aac73e228e40d348268233ee3 /win
parent6d22c2e73a3ed03c5873e3c8cd4d521fe43685e8 (diff)
parent806df88cc60bc06e7d63a19edeb8d162cd481a29 (diff)
downloadmariadb-git-2004bd1736d0a984c12b1d56156f5552816c80f4.tar.gz
merge
Diffstat (limited to 'win')
-rw-r--r--win/packaging/ca/CustomAction.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/win/packaging/ca/CustomAction.cpp b/win/packaging/ca/CustomAction.cpp
index e943d1a58b8..dbce86804c8 100644
--- a/win/packaging/ca/CustomAction.cpp
+++ b/win/packaging/ca/CustomAction.cpp
@@ -80,7 +80,7 @@ LExit:
It is assumed that called will add double quotation marks before and after
the string.
*/
-static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
+static void EscapeCommandLine(const wchar_t *in, wchar_t *out, size_t buflen)
{
const wchar_t special_chars[]=L" \t\n\v\"";
bool needs_escaping= false;
@@ -97,7 +97,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
if(!needs_escaping)
{
- wcscpy(out, in);
+ wcscpy_s(out, buflen, in);
return;
}
@@ -119,7 +119,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
Escape all backslashes, but let the terminating double quotation mark
that caller adds be interpreted as a metacharacter.
*/
- for(int j= 0; j < 2*n_backslashes;j++)
+ for(size_t j= 0; j < 2*n_backslashes;j++)
{
out[pos++]=L'\\';
}
@@ -130,7 +130,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
/*
Escape all backslashes and the following double quotation mark.
*/
- for(int j= 0; j < 2*n_backslashes + 1; j++)
+ for(size_t j= 0; j < 2*n_backslashes + 1; j++)
{
out[pos++]=L'\\';
}
@@ -139,7 +139,7 @@ static void EscapeCommandLine(const wchar_t *in, wchar_t *out)
else
{
/* Backslashes aren't special here. */
- for (int j=0; j < n_backslashes; j++)
+ for (size_t j=0; j < n_backslashes; j++)
out[pos++] = L'\\';
out[pos++]= c;
@@ -592,7 +592,8 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
DWORD PasswordLen= MAX_PATH;
MsiGetPropertyW (hInstall, L"PASSWORD", Password, &PasswordLen);
- EscapeCommandLine(Password, EscapedPassword);
+ EscapeCommandLine(Password, EscapedPassword,
+ sizeof(EscapedPassword)/sizeof(EscapedPassword[0]));
MsiSetPropertyW(hInstall,L"ESCAPEDPASSWORD",EscapedPassword);
DWORD SkipNetworkingLen= MAX_PATH;