libsffs: resolve Coverity warnings
This commit is contained in:
parent
0b30c0a1bb
commit
ee71bbbcb5
2 changed files with 4 additions and 4 deletions
|
@ -82,7 +82,7 @@ struct inode *ino;
|
|||
|
||||
link_inode(parent, ino);
|
||||
|
||||
strcpy(ino->i_name, name);
|
||||
strlcpy(ino->i_name, name, sizeof(ino->i_name));
|
||||
|
||||
/* hash_add(ino); */
|
||||
slot = hash_dentry(parent, ino->i_name);
|
||||
|
|
|
@ -58,8 +58,8 @@ struct inode *ino;
|
|||
*/
|
||||
if (!prefix[0] && p[0] == '/') p++;
|
||||
|
||||
strcpy(path, prefix);
|
||||
strcpy(&path[plen], p);
|
||||
strlcpy(path, prefix, PATH_MAX);
|
||||
strlcpy(&path[plen], p, PATH_MAX - plen);
|
||||
|
||||
dprintf(("%s: make_path: resulting path is '%s'\n", sffs_name, path));
|
||||
|
||||
|
@ -85,7 +85,7 @@ char *name;
|
|||
return ENAMETOOLONG;
|
||||
|
||||
if (len > 0) path[len++] = '/';
|
||||
strcpy(&path[len], name);
|
||||
strlcpy(&path[len], name, PATH_MAX - len);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue