Index: source/lobby/IXmppClient.h =================================================================== --- source/lobby/IXmppClient.h +++ source/lobby/IXmppClient.h @@ -22,7 +22,7 @@ class ScriptInterface; namespace StunClient { -class StunEndpoint; + struct StunEndpoint; } class IXmppClient Index: source/lobby/glooxwrapper/glooxwrapper.h =================================================================== --- source/lobby/glooxwrapper/glooxwrapper.h +++ source/lobby/glooxwrapper/glooxwrapper.h @@ -637,9 +637,8 @@ { private: const gloox::Jingle::Session::Jingle* m_Wrapped; - bool m_Owned; public: - Jingle(const gloox::Jingle::Session::Jingle* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {} + Jingle(const gloox::Jingle::Session::Jingle* wrapped, bool UNUSED(owned)) : m_Wrapped(wrapped) {} const PluginList plugins() const; Index: source/network/StunClient.cpp =================================================================== --- source/network/StunClient.cpp +++ source/network/StunClient.cpp @@ -121,6 +121,15 @@ return true; } +bool GetByteFromBuffer(const std::vector& buffer, u32& offset, u8& result) +{ + if (offset + 1 > buffer.size()) + return false; + + result = buffer[offset++]; + return true; +} + /** * Creates a STUN request and sends it to a STUN server. * The request is sent through transactionHost, from which the answer @@ -268,7 +277,7 @@ for (std::size_t i = 0; i < sizeof(m_TransactionID); ++i) { u8 transactionChar = 0; - if (!GetFromBuffer(buffer, offset, transactionChar) || transactionChar != m_TransactionID[i]) + if (!GetByteFromBuffer(buffer, offset, transactionChar) || transactionChar != m_TransactionID[i]) { LOGERROR("STUN response doesn't contain the transaction ID"); return false; @@ -304,7 +313,7 @@ ++offset; u8 ipFamily = 0; - if (!GetFromBuffer(buffer, offset, ipFamily) || ipFamily != m_IPAddressFamilyIPv4) + if (!GetByteFromBuffer(buffer, offset, ipFamily) || ipFamily != m_IPAddressFamilyIPv4) { LOGERROR("Unsupported address family, IPv4 is expected"); return false;