From: Rickard Strandqvist Date: Sat, 9 Aug 2014 23:46:49 +0000 (+0200) Subject: staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null-terminate after... X-Git-Tag: firefly_0821_release~176^2~3315^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=299ef8cd6556d9cd968f672ad30c6df4cfcfc729;p=firefly-linux-kernel-4.4.55.git staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null-terminate after strncpy call Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist Reviewed-by: Kees Cook Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index 65629579bd7d..03ab9e046784 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -365,6 +365,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, return -ENOMEM; strncpy(sched->ws_name, name, CFS_WS_NAME_LEN); + sched->ws_name[CFS_WS_NAME_LEN - 1] = '\0'; sched->ws_cptab = cptab; sched->ws_cpt = cpt;