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

Commit bed3b10d authored by Ken Cox's avatar Ken Cox Committed by Greg Kroah-Hartman
Browse files

Staging: unisys: virthba: Fix variable length array



A character array was declared on the stack with variable length.  This has
been corrected to use a fixed length.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKen Cox <jkc@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a16a0276
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1439,12 +1439,15 @@ static ssize_t
enable_ints_write(struct file *file, const char __user *buffer,
		  size_t count, loff_t *ppos)
{
	char buf[count + 1];
	char buf[4];
	int i, new_value;
	struct virthba_info *virthbainfo;
	U64 *Features_addr;
	U64 mask;

	if (count >= ARRAY_SIZE(buf))
		return -EINVAL;

	buf[count] = '\0';
	if (copy_from_user(buf, buffer, count)) {
		LOGERR("copy_from_user failed. buf<<%.*s>> count<<%lu>>\n",