staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null-terminate after...
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sat, 9 Aug 2014 23:46:49 +0000 (01:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Aug 2014 14:15:10 +0000 (07:15 -0700)
Added a guaranteed null-terminate after call to strncpy.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/workitem.c

index 65629579bd7d8c11a66c12bd7d43a51ee98ff883..03ab9e046784c0d598b43e26f97fad2ca1aafcdd 100644 (file)
@@ -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;