From 1d36871179fb325cd8a7363fa71fe187d0ddfc14 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 17 Mar 2017 12:47:25 +0300 Subject: fix for buffer overrun --- protocols/JabberG/src/jabber_omemo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index 232f1ea78c..ce5c2c1208 100755 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -614,7 +614,7 @@ void CJabberProto::OmemoAnnounceDevice() // construct node wchar_t szBareJid[JABBER_MAX_JID_LEN]; XmlNodeIq iq(L"set", SerialNext()); - iq << XATTR(L"from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, sizeof(szBareJid))); //_countof is not portable + iq << XATTR(L"from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, _countof(szBareJid))); HXML publish_node = iq << XCHILDNS(L"pubsub", L"http://jabber.org/protocol/pubsub") << XCHILD(L"publish") << XATTR(L"node", JABBER_FEAT_OMEMO L":devicelist"); //pubsub_createnode(JABBER_FEAT_OMEMO L":devicelist", L"TODO_pubsub_address", this); //TODO: get pubsub address somehow //TODO: handle reply of createnode @@ -642,7 +642,7 @@ void CJabberProto::OmemoSendBundle() // construct bundle node wchar_t szBareJid[JABBER_MAX_JID_LEN]; XmlNodeIq iq(L"set", SerialNext()); - iq << XATTR(L"from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, sizeof(szBareJid))); //_countof is not portable + iq << XATTR(L"from", JabberStripJid(m_ThreadInfo->fullJID, szBareJid, _countof(szBareJid))); HXML publish_node = iq << XCHILDNS(L"pubsub", L"http://jabber.org/protocol/pubsub") << XCHILD(L"publish"); { -- cgit v1.2.3