trace: resolve stack corruption due to string copy
Strcpy has no limit on string being copied which causes stack corruption leading to kernel panic. Use strlcpy to resolve the issue by providing length of string to be copied. CRs-fixed: 1048480 Change-Id: Ib290b25f7e0ff96927b8530e5c078869441d409f Signed-off-by: Amey Telawane <ameyt@codeaurora.org>
This commit is contained in:
parent
272879fc1f
commit
e1255386b6
1 changed files with 1 additions and 1 deletions
|
@ -1634,7 +1634,7 @@ static void __trace_find_cmdline(int pid, char comm[])
|
|||
|
||||
map = savedcmd->map_pid_to_cmdline[pid];
|
||||
if (map != NO_CMDLINE_MAP)
|
||||
strcpy(comm, get_saved_cmdlines(map));
|
||||
strlcpy(comm, get_saved_cmdlines(map), TASK_COMM_LEN - 1);
|
||||
else
|
||||
strcpy(comm, "<...>");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue