Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;