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 6562957..03ab9e0 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;