mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
connection-test: Pad out strings with null bytes
The connection_demarshal test writes a 10 byte string into a wayland message, but doesn't pad it out to a four byte boundary. This leads to the last 32-bit word of the message being partially uninitialized, which triggers an msan violation when the message is written to the socket. Signed-off-by: Fergus Dall <sidereal@google.com>
This commit is contained in:
parent
f6b78b76b2
commit
e5c3ac9bcd
1 changed files with 2 additions and 0 deletions
|
|
@ -431,6 +431,7 @@ TEST(connection_demarshal)
|
|||
msg[0] = 400200;
|
||||
msg[1] = 24 << 16;
|
||||
msg[2] = 10;
|
||||
msg[3 + msg[2]/4] = 0;
|
||||
memcpy(&msg[3], data.value.s, msg[2]);
|
||||
demarshal(&data, "s", msg, (void *) validate_demarshal_s);
|
||||
|
||||
|
|
@ -438,6 +439,7 @@ TEST(connection_demarshal)
|
|||
msg[0] = 400200;
|
||||
msg[1] = 24 << 16;
|
||||
msg[2] = 10;
|
||||
msg[3 + msg[2]/4] = 0;
|
||||
memcpy(&msg[3], data.value.s, msg[2]);
|
||||
demarshal(&data, "?s", msg, (void *) validate_demarshal_s);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue