From 97fe0e28cae9ab3d9131dc13103027cb41aa21c8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 May 2013 18:37:42 +0000 Subject: fix against mir_realloc in Skype git-svn-id: http://svn.miranda-ng.org/main/trunk@4625 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/sendqueue.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'plugins/TabSRMM/src') 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) -- cgit v1.2.3