mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 18:55:10 +01:00
Fix build on arm64 architectures with some strict compilers
This patch fixes an issue that occurs on 64-bit architetures under strict compiler rules. The code initially checked that the received size stored in 'uint64_t' was not bigger than the max value of a 'size_t' variable, which is legitimate on 32-bit architectures where 'size_t' variables are stored on 32 bits. On 64-bit architectures, this test no longer makes sense since 'uint64_t' and 'size_t' types have the same size. The issue is fixed by ignoring this portion of code when built for arm64.
This commit is contained in:
parent
2e2806d744
commit
ffe62d3398
@ -111,11 +111,13 @@ int zmq::v1_decoder_t::eight_byte_size_ready (unsigned char const *)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef __aarch64__
|
||||
// Message size must fit within range of size_t data type.
|
||||
if (payload_length - 1 > std::numeric_limits<size_t>::max ()) {
|
||||
errno = EMSGSIZE;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
const size_t msg_size = static_cast<size_t> (payload_length - 1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user