Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <rickard_strandqvist@spectrumdigital.se>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rickard Strandqvist and committed by
Greg Kroah-Hartman
299ef8cd ec0a38bf

+1
+1
drivers/staging/lustre/lustre/libcfs/workitem.c
··· 365 365 return -ENOMEM; 366 366 367 367 strncpy(sched->ws_name, name, CFS_WS_NAME_LEN); 368 + sched->ws_name[CFS_WS_NAME_LEN - 1] = '\0'; 368 369 sched->ws_cptab = cptab; 369 370 sched->ws_cpt = cpt; 370 371