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

Commit d86e1731 authored by Lior Barenboim's avatar Lior Barenboim Committed by Gerrit - the friendly Code Review server
Browse files

QBT1000: check for null pointer before copying command



A null command buffer will cause a null pointer crash.
Check for it

Change-Id: I37a0c8b9fe2c144fb4e75036509bf7ec07604ea7
Signed-off-by: default avatarLior Barenboim <liorb@codeaurora.org>
parent 624c9138
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -913,6 +913,13 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
		if (rc != 0)
			goto end;

		if (!aligned_cmd) {
			dev_err(drvdata->dev, "%s: Null command buffer\n",
				__func__);
			rc = -EINVAL;
			goto end;
		}

		rc = copy_from_user(aligned_cmd, (void __user *)tzcmd.req_buf,
				tzcmd.req_buf_len);
		if (rc != 0) {