From aed337ad90f145991a39b7900b8d42dc18178366 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 7 Apr 2015 19:17:54 +0000 Subject: SecureIM: - Minor Fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@12661 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SecureIM/src/svcs_proto.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/SecureIM/src/svcs_proto.cpp') diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index e583506158..0ebc1de9ed 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -487,11 +487,10 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) // pass unhandled messages if (!ptr || ssig == SiG_GAME || ssig == SiG_PGPM || ssig == SiG_SECU || ssig == SiG_SECP || - isChatRoom(pccsd->hContact) || stat == -1 || - (ssig == SiG_NONE && ptr->sendQueue) || (ssig == SiG_NONE && ptr->status == STATUS_DISABLED)) { - return CallService(MS_PROTO_CHAINSEND, wParam, lParam); - - Sent_NetLog("onSendMsg: pass unhandled"); + isChatRoom(pccsd->hContact) || stat == -1 || + (ssig == SiG_NONE && ptr->sendQueue) || (ssig == SiG_NONE && ptr->status == STATUS_DISABLED)) { + Sent_NetLog("onSendMsg: pass unhandled"); + return CallService(MS_PROTO_CHAINSEND, wParam, lParam); } // @@ -840,9 +839,11 @@ int __cdecl onProtoAck(WPARAM wParam, LPARAM lParam) ACKDATA *ack = (ACKDATA*)lParam; if (ack->type != ACKTYPE_FILE) return 0; //quit if not file transfer event PROTOFILETRANSFERSTATUS *f = (PROTOFILETRANSFERSTATUS*)ack->lParam; + if (!f) + return 0; pUinKey ptr = getUinKey(ack->hContact); - if (!ptr || (f && (f->flags & PFTS_SENDING) && !bSFT)) return 0; + if (!ptr || ((f->flags & PFTS_SENDING) && !bSFT)) return 0; if (isContactSecured(ack->hContact)&SECURED) { switch (ack->result) { @@ -893,7 +894,7 @@ int __cdecl onProtoAck(WPARAM wParam, LPARAM lParam) LPSTR p = strrchr(file_out, '.'); LPSTR x = strrchr(file_out, '\\'); if (p > x) { - strcpy(buf, p); + strncpy(buf, p, sizeof(buf)-1); pos = p; } for (int i = 1; i < 10000; i++) { -- cgit v1.2.3