summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/steam_dialogs.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 15:57:46 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 15:57:46 +0000
commit62713cf3eece92588464ce06810146f5c5cece8e (patch)
tree71488ce81ab34b82edcfb5001af991a6e167f8a0 /protocols/Steam/src/steam_dialogs.cpp
parentd23b4b4b1ccc9549aa8fc12326e7d7f135f1ce39 (diff)
Steam: fix memory corruptions
git-svn-id: http://svn.miranda-ng.org/main/trunk@15487 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Steam/src/steam_dialogs.cpp')
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 6ea6aecd28..a773a3bd3b 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -38,9 +38,12 @@ void CSteamPasswordEditor::OnClose()
/////////////////////////////////////////////////////////////////////////////////
CSteamGuardDialog::CSteamGuardDialog(CSteamProto *proto, const char *domain)
- : CSteamDlgBase(proto, IDD_GUARD, false), m_ok(this, IDOK),
- m_text(this, IDC_TEXT), m_link(this, IDC_GETDOMAIN, domain)
+ : CSteamDlgBase(proto, IDD_GUARD, false),
+ m_ok(this, IDOK),
+ m_text(this, IDC_TEXT),
+ m_link(this, IDC_GETDOMAIN, domain)
{
+ memset(m_guardCode, 0, sizeof(m_guardCode));
mir_strcpy(m_domain, domain);
m_ok.OnClick = Callback(this, &CSteamGuardDialog::OnOk);
}
@@ -59,7 +62,7 @@ void CSteamGuardDialog::OnInitDialog()
void CSteamGuardDialog::OnOk(CCtrlButton*)
{
- mir_strncpy(m_guardCode, ptrA(m_text.GetTextA()), _countof(m_guardCode) + 1);
+ mir_strncpy(m_guardCode, ptrA(m_text.GetTextA()), _countof(m_guardCode));
EndDialog(m_hwnd, 1);
}
@@ -80,6 +83,7 @@ CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, BYTE *captchaImage,
m_ok(this, IDOK), m_text(this, IDC_TEXT),
m_captchaImage(NULL)
{
+ memset(m_captchaText, 0, sizeof(m_captchaText));
m_captchaImageSize = captchaImageSize;
m_captchaImage = (BYTE*)mir_alloc(captchaImageSize);
memcpy(m_captchaImage, captchaImage, captchaImageSize);
@@ -106,7 +110,7 @@ void CSteamCaptchaDialog::OnInitDialog()
void CSteamCaptchaDialog::OnOk(CCtrlButton*)
{
- mir_strncpy(m_captchaText, ptrA(m_text.GetTextA()), _countof(m_captchaText) + 1);
+ mir_strncpy(m_captchaText, ptrA(m_text.GetTextA()), _countof(m_captchaText));
EndDialog(m_hwnd, 1);
}