Skip to content

Commit

Permalink
staging: lustre: lustre: libcfs: workitem.c: Cleaning up missing null…
Browse files Browse the repository at this point in the history
…-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>
  • Loading branch information
Rickard Strandqvist authored and Greg Kroah-Hartman committed Aug 17, 2014
1 parent ec0a38b commit 299ef8c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/lustre/lustre/libcfs/workitem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 299ef8c

Please sign in to comment.