mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-04 07:27:26 +01:00
Problem: test_msg_ffn uses unitialised memory
Solution: pass correct size to memcmp to avoid reading uninitialised areas of the buffer.
This commit is contained in:
parent
e177512c82
commit
f8f8043222
@ -94,7 +94,7 @@ int main (void) {
|
||||
assert (rc > -1);
|
||||
rc = zmq_recv(router, buf, 255, 0);
|
||||
assert (rc == 255);
|
||||
assert (memcmp(data, buf, 5) == 0);
|
||||
assert (memcmp(data, buf, 4) == 0);
|
||||
|
||||
msleep(50);
|
||||
assert (memcmp(hint, "freed", 5) == 0);
|
||||
@ -115,7 +115,7 @@ int main (void) {
|
||||
assert (rc > -1);
|
||||
rc = zmq_recv(router, buf, 255, 0);
|
||||
assert (rc == 255);
|
||||
assert (memcmp(data, buf, 5) == 0);
|
||||
assert (memcmp(data, buf, 4) == 0);
|
||||
rc = zmq_msg_close(&msg2);
|
||||
assert (rc == 0);
|
||||
rc = zmq_msg_close(&msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user