summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2013-04-24 16:52:22 +0200
committerPeter Wu <lekensteyn@gmail.com>2013-04-24 16:52:22 +0200
commit957ce488fc519af350f2c49ccd7ff9afbb02eec7 (patch)
tree78c4bc97565d3f8afdc40cf9ba690608df7413c5
parentf761d31d0b7780dba92da8c39e08d97d2c47bd61 (diff)
downloadltunify-957ce488fc519af350f2c49ccd7ff9afbb02eec7.tar.gz
ltunify: fix copying one byte too much (caught by -fsanitze=address)
-rw-r--r--ltunify.c2
1 files changed, 1 insertions, 1 deletions
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)) {