From 957ce488fc519af350f2c49ccd7ff9afbb02eec7 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 24 Apr 2013 16:52:22 +0200 Subject: ltunify: fix copying one byte too much (caught by -fsanitze=address) --- ltunify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ltunify.c b/ltunify.c index 44b35e2..06aef40 100644 --- a/ltunify.c +++ b/ltunify.c @@ -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)) { -- cgit v1.2.1