summaryrefslogtreecommitdiff
path: root/protocols/Tox/src
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-09-11 19:09:52 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-09-11 19:09:52 +0000
commitc4ea93a17131c5c88d52241487c1f8f107533f4c (patch)
treed517b6036cdc904af8293a84d8f19a591141b6a6 /protocols/Tox/src
parentde88bf6b0749283fa8c0f1548e366efcb36759dd (diff)
Tox: some crash fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@10433 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r--protocols/Tox/src/tox_transfer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index 5bb4159359..ac0a145dee 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -57,7 +57,7 @@ void CToxProto::OnFriendFile(Tox *tox, int32_t number, uint8_t fileNumber, uint6
HANDLE __cdecl CToxProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const PROTOCHAR* tszPath)
{
DBVARIANT dbv;
- std::vector<uint8_t> id;
+ std::vector<uint8_t> id(TOX_CLIENT_ID_SIZE);
if (!db_get(hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv))
{
memcpy(&id[0], dbv.pbVal, TOX_CLIENT_ID_SIZE);
@@ -88,7 +88,7 @@ int __cdecl CToxProto::FileResume(HANDLE hTransfer, int* action, const PROTOCHAR
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
DBVARIANT dbv;
- std::vector<uint8_t> id;
+ std::vector<uint8_t> id(TOX_CLIENT_ID_SIZE);
if (!db_get(transfer->pfts.hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv))
{
memcpy(&id[0], dbv.pbVal, TOX_CLIENT_ID_SIZE);
@@ -263,7 +263,7 @@ void CToxProto::SendFileAsync(void* arg)
int __cdecl CToxProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
{
DBVARIANT dbv;
- std::vector<uint8_t> id;
+ std::vector<uint8_t> id(TOX_CLIENT_ID_SIZE);
if (!db_get(hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv))
{
memcpy(&id[0], dbv.pbVal, TOX_CLIENT_ID_SIZE);