mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
net: initialize nMessageSize to max uint32_t instead of -1
nMessageSize is uint32_t and is set to -1. This will warn with -fsanitize=implicit-integer-sign-change.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include <uint256.h>
|
||||
#include <version.h>
|
||||
|
||||
#include <limits>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
@@ -51,7 +52,7 @@ public:
|
||||
|
||||
char pchMessageStart[MESSAGE_START_SIZE];
|
||||
char pchCommand[COMMAND_SIZE];
|
||||
uint32_t nMessageSize;
|
||||
uint32_t nMessageSize{std::numeric_limits<uint32_t>::max()};
|
||||
uint8_t pchChecksum[CHECKSUM_SIZE];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user