ltunify: fix copying one byte too much (caught by -fsanitze=address)

This commit is contained in:
Peter Wu
2013-04-24 16:52:22 +02:00
parent f761d31d0b
commit 957ce488fc

View File

@@ -449,7 +449,7 @@ static bool get_register(int fd, u8 device_index, u8 address,
memset(msg.msg_short.value, 0, sizeof msg.msg_short.value);
msg.msg_short.address = address;
if (params) {
memcpy(&msg.msg_short.value, params, SHORT_MESSAGE_LEN - HEADER_SIZE);
memcpy(&msg.msg_short.value, params, sizeof msg.msg_short.value);
}
if (!do_write(fd, &msg)) {