From 78262b41bd8d2bec9d50ac736302eaa389369404 Mon Sep 17 00:00:00 2001 From: Diadlo Date: Fri, 17 Nov 2017 23:37:46 +0300 Subject: [PATCH] fix(core): Check that result of get peer name is successful Fix #4802 --- src/core/core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/core.cpp b/src/core/core.cpp index c7aaf9881..6e3895e96 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -1126,6 +1126,10 @@ QStringList Core::getGroupPeerNames(int groupId) const QStringList names; for (uint32_t i = 0; i < nPeers; ++i) { size_t length = tox_conference_peer_get_name_size(tox, groupId, i, &error); + if (!parsePeerQueryError(error)) { + continue; + } + QByteArray name(length, Qt::Uninitialized); uint8_t* namePtr = static_cast(static_cast(name.data())); bool ok = tox_conference_peer_get_name(tox, groupId, i, namePtr, &error);