Commit f8f80432 authored by Luca Boccassi's avatar Luca Boccassi

Problem: test_msg_ffn uses unitialised memory

Solution: pass correct size to memcmp to avoid reading uninitialised
areas of the buffer.
parent e177512c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment