Merge pull request #831 from amnezia-vpn/bugfix/wg-show-possible-crash-fix

This commit is contained in:
pokamest 2024-06-03 08:49:26 +01:00 committed by GitHub
commit 9fe75c6120
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -281,7 +281,8 @@ ErrorCode ClientManagementModel::wgShow(const DockerContainer container, const S
}
};
for (int i = 0; i < peerList.size() && i < transferredDataList.size(); ++i) {
for (int i = 0; i < peerList.size() && i < transferredDataList.size() && i < latestHandshakeList.size(); ++i) {
const auto transferredData = getStrValue(transferredDataList[i]).split(",");
auto latestHandshake = getStrValue(latestHandshakeList[i]);
auto serverBytesReceived = transferredData.front().trimmed();