summaryrefslogtreecommitdiff
path: root/protocols/Steam
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
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')
-rw-r--r--protocols/Steam/src/request_queue.cpp1
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp12
-rw-r--r--protocols/Steam/src/steam_dialogs.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/protocols/Steam/src/request_queue.cpp b/protocols/Steam/src/request_queue.cpp
index 12f9beb61c..ab5a7e0d75 100644
--- a/protocols/Steam/src/request_queue.cpp
+++ b/protocols/Steam/src/request_queue.cpp
@@ -78,6 +78,7 @@ void RequestQueue::Execute(RequestQueueItem *item)
if (item->finallyCallback != NULL)
item->finallyCallback(item->arg);
delete item;
+ delete response;
}
unsigned int RequestQueue::AsyncSendThread(void *owner, void *arg)
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);
}
diff --git a/protocols/Steam/src/steam_dialogs.h b/protocols/Steam/src/steam_dialogs.h
index 21cc2e2033..2915e5fecc 100644
--- a/protocols/Steam/src/steam_dialogs.h
+++ b/protocols/Steam/src/steam_dialogs.h
@@ -28,7 +28,7 @@ class CSteamGuardDialog : public CSteamDlgBase
{
private:
char m_domain[32];
- char m_guardCode[5];
+ char m_guardCode[6];
CCtrlEdit m_text;
CCtrlButton m_ok;
@@ -50,7 +50,7 @@ public:
class CSteamCaptchaDialog : public CSteamDlgBase
{
private:
- char m_captchaText[6];
+ char m_captchaText[7];
BYTE *m_captchaImage;
int m_captchaImageSize;