aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-06-24 14:13:19 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-06-24 14:13:19 -0500
commit14a1b89122406a937d7e0bc3712d6fc8ae675b64 (patch)
tree9e4eb8746a1b4985aecb01936b8475cf49975d38 /src
parentMerge pull request #7750 (diff)
parentunit_tests: check for ge_frombytes_vartime failure (diff)
downloadmonero-14a1b89122406a937d7e0bc3712d6fc8ae675b64.tar.xz
Merge pull request #7752
4251cc0 unit_tests: check for ge_frombytes_vartime failure (moneromooo-monero) 67b97a5 easylogging++: do not delete uninitialized objects (moneromooo-monero) 7b6d959 trezor: fix potential use of uninitialized memory (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/device_trezor/trezor/transport.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/device_trezor/trezor/transport.cpp b/src/device_trezor/trezor/transport.cpp
index 194176413..7a79d8f95 100644
--- a/src/device_trezor/trezor/transport.cpp
+++ b/src/device_trezor/trezor/transport.cpp
@@ -573,8 +573,13 @@ namespace trezor{
std::string req = "PINGPING";
char res[8];
- m_socket->send_to(boost::asio::buffer(req.c_str(), req.size()), m_endpoint);
- receive(res, 8, nullptr, false, timeout);
+ const auto written = m_socket->send_to(boost::asio::buffer(req.c_str(), req.size()), m_endpoint);
+ if (written != req.size())
+ return false;
+ memset(res, 0, sizeof(res));
+ const auto received = receive(res, 8, nullptr, false, timeout);
+ if (received != 8)
+ return false;
return memcmp(res, "PONGPONG", 8) == 0;