mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-12 18:40:27 +01:00
Merge pull request #4019 from bluca/fuzz_options
Problem: zmq_z85_decode doesn't check its input length
This commit is contained in:
commit
36dc251ed0
3
NEWS
3
NEWS
@ -55,6 +55,9 @@
|
||||
* ZMTP 3.1 peers will receive subscribe/cancel on PUB/SUB via commands rather
|
||||
than using the first byte of the payload.
|
||||
|
||||
* zmq_z85_decode now checks that the input string's length is at least 5 characters
|
||||
and always a multiple of 5 as per API specification.
|
||||
|
||||
* Fixed #3566 - malformed CURVE message can cause memory leak
|
||||
|
||||
* Fixed #3567 - missing ZeroMQ_INCLUDE_DIR in ZeroMQConfig.cmake when only
|
||||
|
@ -166,6 +166,11 @@ uint8_t *zmq_z85_decode (uint8_t *dest_, const char *string_)
|
||||
unsigned int byte_nbr = 0;
|
||||
unsigned int char_nbr = 0;
|
||||
uint32_t value = 0;
|
||||
size_t src_len = strlen (string_);
|
||||
|
||||
if (src_len < 5 || src_len % 5 != 0)
|
||||
goto error_inval;
|
||||
|
||||
while (string_[char_nbr]) {
|
||||
// Accumulate value in base 85
|
||||
if (UINT32_MAX / 85 < value) {
|
||||
|
Loading…
Reference in New Issue
Block a user