提交 c3ac54a6 编写于 作者: D Dan Carpenter 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册