mirror of
https://github.com/zeromq/libzmq.git
synced 2025-04-20 07:51:35 +02:00
Problem: test_msg_ffn uses unitialised memory
Solution: memset temporary buffer before use to reduce Valgrind noise
This commit is contained in:
parent
240190131c
commit
955b51dfd2
@ -57,6 +57,7 @@ int main (void) {
|
|||||||
zmq_msg_t msg;
|
zmq_msg_t msg;
|
||||||
char hint[5];
|
char hint[5];
|
||||||
char data[255];
|
char data[255];
|
||||||
|
memset(data, 0, 255);
|
||||||
memcpy(data, (void *) "data", 4);
|
memcpy(data, (void *) "data", 4);
|
||||||
memcpy(hint, (void *) "hint", 4);
|
memcpy(hint, (void *) "hint", 4);
|
||||||
rc = zmq_msg_init_data(&msg, (void *)data, 255, ffn, (void*)hint);
|
rc = zmq_msg_init_data(&msg, (void *)data, 255, ffn, (void*)hint);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user