diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-11-23 10:25:56 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-11-23 10:26:25 +0100 |
commit | 1b75f2542d154ba6f9f75bc2c9d7a0ca54de784c (patch) | |
tree | c36124ef1d01cf895ec7148daab1579ceeb93fed /src/test/fuzz/p2p_transport_deserializer.cpp | |
parent | e9a1c9fbdea977edbb4d10d0368cc7c3199bc469 (diff) | |
parent | fabecce71909c984504c21fa05f91d5f1b471e8c (diff) |
Merge #20432: net: Treat raw message bytes as uint8_t
fabecce71909c984504c21fa05f91d5f1b471e8c net: Treat raw message bytes as uint8_t (MarcoFalke)
Pull request description:
Using `uint8_t` from the beginning when messages are `recv`ed has two style benefits:
* The signedness is clear from reading the code, as it does not depend on the architecture
* When passing the bytes on, the need for static signedness casts is dropped, making the code a bit less verbose and more coherent
ACKs for top commit:
laanwj:
Code review ACK fabecce71909c984504c21fa05f91d5f1b471e8c
theStack:
Code Review ACK fabecce71909c984504c21fa05f91d5f1b471e8c
jonatack:
Tested ACK fabecce71909c984504c21fa05f91d5f1b471e8c
Tree-SHA512: e6d9803c78633fde3304faf592afa961ff9462a7912d1da97a24720265274aa10ab4168d71b6ec2756b7448dd42585321afee0e5c889e705be778ce9a330d145
Diffstat (limited to 'src/test/fuzz/p2p_transport_deserializer.cpp')
-rw-r--r-- | src/test/fuzz/p2p_transport_deserializer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/fuzz/p2p_transport_deserializer.cpp b/src/test/fuzz/p2p_transport_deserializer.cpp index 3feabcc99a..7a6236efac 100644 --- a/src/test/fuzz/p2p_transport_deserializer.cpp +++ b/src/test/fuzz/p2p_transport_deserializer.cpp @@ -21,7 +21,7 @@ void test_one_input(const std::vector<uint8_t>& buffer) { // Construct deserializer, with a dummy NodeId V1TransportDeserializer deserializer{Params(), (NodeId)0, SER_NETWORK, INIT_PROTO_VERSION}; - Span<const char> msg_bytes{(const char*)buffer.data(), buffer.size()}; + Span<const uint8_t> msg_bytes{buffer}; while (msg_bytes.size() > 0) { const int handled = deserializer.Read(msg_bytes); if (handled < 0) { |