Commit c3ac54a6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jassi Brar

mailbox: Off by one in mbox_test_message_read()

We need to leave space for the NUL char.

Fixes: 8ea4484d ('mailbox: Add generic mechanism for testing Mailbox Controllers')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
parent 8e3c5952
......@@ -143,7 +143,7 @@ static ssize_t mbox_test_message_read(struct file *filp, char __user *userbuf,
int l = 0;
int ret;
touser = kzalloc(MBOX_HEXDUMP_MAX_LEN, GFP_KERNEL);
touser = kzalloc(MBOX_HEXDUMP_MAX_LEN + 1, GFP_KERNEL);
if (!touser)
return -ENOMEM;
......
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