pmaports/device/testing/linux-oppo-find-7a/0007_get_task_warning.patch
Oliver Smith 64035ac463
device/*: move to device/testing/* (!1063)
Prepare for better device categorization by moving everything to testing
subdir first.

[skip-ci]: chicken-egg problem: passing pmaports CI depends on pmbootstrap MR
				depends on this MR

Related: postmarketos#16
2020-03-14 08:35:32 +01:00

16 lines
487 B
Diff

diff --git a/fs/exec.c b/fs/exec.c
index 6be2aa0ab26f..3e8012afe440 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1218,9 +1218,9 @@ static int de_thread(struct task_struct *tsk)
char *get_task_comm(char *buf, struct task_struct *tsk)
{
- /* buf must be at least sizeof(tsk->comm) in size */
+ /* buf must be at least TASK_COMM_LEN in size */
task_lock(tsk);
- strncpy(buf, tsk->comm, sizeof(tsk->comm));
+ strlcpy(buf, tsk->comm, TASK_COMM_LEN);
task_unlock(tsk);
return buf;
}