pmaports/device/linux-oppo-find-7a/0007_get_task_warning.patch
Tito Ragusa 292e742220
oppo-find-7a: linux: various improvements (!580)
* add dev-package
* modularize some kernel drivers
* modernize Makefile to silence some warnings
* fix various warnings
* add some CVE patches

[ci:skip-build]: already built successfully in CI
2019-08-31 15:30:38 +02: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;
}