summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-05-10 18:37:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-05-10 18:37:42 +0000
commit97fe0e28cae9ab3d9131dc13103027cb41aa21c8 (patch)
tree1a17e0b89d70c5adc446b946a6a562aa28b7d978
parentc16bfe00dc27525c03e36cca6930abe5a9fd43a7 (diff)
fix against mir_realloc in Skype
git-svn-id: http://svn.miranda-ng.org/main/trunk@4625 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Scriver/src/globals.cpp1
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp13
2 files changed, 4 insertions, 10 deletions
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index dd739d10f1..cb9feb1564 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -456,6 +456,7 @@ static int ackevent(WPARAM wParam, LPARAM lParam)
MessageWindowEvent evt = { sizeof(evt), (int)item->hSendId, item->hContact, &dbei };
NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt);
+ item->sendBuffer = (char*)dbei.pBlob;
db_event_add(item->hContact, &dbei);
if (item->hwndErrorDlg != NULL)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 73c3e505e3..7807a4d193 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -104,17 +104,9 @@ entry_found:
}
SendJob &job = m_jobs[iFound];
- int iLength = iLen;
- if (iLength > 0) {
- if (job.szSendBuffer == NULL) {
- if (iLength < HISTORY_INITIAL_ALLOCSIZE)
- iLength = HISTORY_INITIAL_ALLOCSIZE;
- job.szSendBuffer = (char*)mir_alloc(iLength);
- }
- else job.szSendBuffer = (char*)mir_realloc(job.szSendBuffer, iLength);
+ job.szSendBuffer = (char*)mir_alloc(iLen);
+ CopyMemory(job.szSendBuffer, dat->sendBuffer, iLen);
- CopyMemory(job.szSendBuffer, dat->sendBuffer, iLen);
- }
job.dwFlags = dwFlags;
job.dwTime = time(NULL);
@@ -748,6 +740,7 @@ inform_and_discard:
MessageWindowEvent evt = { sizeof(evt), (int)job.hSendId, job.hOwner, &dbei };
NotifyEventHooks(PluginConfig.m_event_WriteEvent, 0, (LPARAM)&evt);
+ job.szSendBuffer = (char*)dbei.pBlob;
HANDLE hNewEvent = db_event_add(job.hOwner, &dbei);
if (m_pContainer)