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

Commit fbea4f93 authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

platform: msm_bus: Address potential buffer overflow issue



When allocating the client name string allocate extra char for null
terminator.

Change-Id: I12f1f34e78a325c75356ca1d31d77fc28705cb36
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent 8cebd075
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1369,7 +1369,7 @@ register_adhoc(uint32_t mas, uint32_t slv, char *name, bool active_only)
	}

	len = strnlen(name, MAX_STR_CL);
	client->name = kzalloc(len, GFP_KERNEL);
	client->name = kzalloc((len + 1), GFP_KERNEL);
	if (!client->name) {
		MSM_BUS_ERR("%s: Error allocating client name buf", __func__);
		free_cl_mem(client);