Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-2074 build: fix 'copy into fixed size buffer' errors
[fs/lustre-release.git]
/
libcfs
/
libcfs
/
workitem.c
diff --git
a/libcfs/libcfs/workitem.c
b/libcfs/libcfs/workitem.c
index
49bee6a
..
a22d4a9
100644
(file)
--- a/
libcfs/libcfs/workitem.c
+++ b/
libcfs/libcfs/workitem.c
@@
-439,7
+439,12
@@
cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab,
if (sched == NULL)
return -ENOMEM;
if (sched == NULL)
return -ENOMEM;
- strncpy(sched->ws_name, name, CFS_WS_NAME_LEN);
+ if (strlen(name) > sizeof(sched->ws_name)-1) {
+ LIBCFS_FREE(sched, sizeof(*sched));
+ return -E2BIG;
+ }
+ strncpy(sched->ws_name, name, sizeof(sched->ws_name));
+
sched->ws_cptab = cptab;
sched->ws_cpt = cpt;
sched->ws_cptab = cptab;
sched->ws_cpt = cpt;