Whamcloud - gitweb
LU-4629 libcfs: fix buffer overflow of string buffer
[fs/lustre-release.git] / libcfs / libcfs / workitem.c
index bcb4f39..722b25d 100644 (file)
@@ -442,7 +442,7 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab,
                LIBCFS_FREE(sched, sizeof(*sched));
                return -E2BIG;
        }
-       strncpy(sched->ws_name, name, sizeof(sched->ws_name));
+       strlcpy(sched->ws_name, name, sizeof(sched->ws_name));
 
        sched->ws_cptab = cptab;
        sched->ws_cpt = cpt;