diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-26 16:17:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-26 16:17:37 +0300 |
commit | 07600605510b522c669305feeb0ef3b8d8bfba95 (patch) | |
tree | 6b803d7d01aa5f7712a32a30628757b6c7cad1ee | |
parent | bdd417c28ee9352d886630fae60ae1c14438a0cf (diff) |
fix for ugly form packets from Psi+
-rwxr-xr-x | protocols/JabberG/src/jabber_caps.cpp | 3 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iq.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index d8ed2b6a35..508b7126c1 100755 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -169,6 +169,9 @@ void CJabberProto::OnIqResultCapsDiscoInfo(const TiXmlElement*, CJabberIqInfo *p JSONNode root;
for (auto *field : TiXmlFilter(xform, "field")) {
const char *fieldName = XmlGetAttr(field, "var"), *fieldValue = XmlGetChildText(field, "value");
+ if (fieldValue == nullptr)
+ continue;
+
if (!mir_strcmp(fieldName, "os"))
root.push_back(JSONNode("o", pCaps->m_szOs = mir_strdup(fieldValue)));
else if (!mir_strcmp(fieldName, "os_version"))
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index a6888620f7..ca1f0b1e17 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -295,7 +295,7 @@ bool CJabberIqManager::HandleIqPermanent(const TiXmlElement *pNode) // have to get all data here, in the loop, because there's always possibility that previous handler modified it
const char *szType = XmlGetAttr(pNode, "type");
if (!szType)
- return FALSE;
+ return false;
CJabberIqInfo iqInfo;
iqInfo.m_nIqType = JABBER_IQ_TYPE_FAIL;
@@ -304,14 +304,14 @@ bool CJabberIqManager::HandleIqPermanent(const TiXmlElement *pNode) else if (!mir_strcmpi(szType, "set"))
iqInfo.m_nIqType = JABBER_IQ_TYPE_SET;
else
- return FALSE;
+ return false;
if (!(pInfo->m_nIqTypes & iqInfo.m_nIqType))
continue;
auto *pFirstChild = XmlFirstChild(pNode);
if (!pFirstChild || !pFirstChild->Name())
- return FALSE;
+ return false;
const char *szTagName = pFirstChild->Name();
const char *szXmlns = XmlGetAttr(pFirstChild, "xmlns");
|