libvtreefs: resolve Coverity warnings
This commit is contained in:
parent
90e2b939ab
commit
5909c8ba20
3 changed files with 5 additions and 5 deletions
|
@ -211,7 +211,7 @@ struct inode *add_inode(struct inode *parent, char *name,
|
|||
newnode->i_stat = *stat;
|
||||
newnode->i_indexed = nr_indexed_entries;
|
||||
newnode->i_cbdata = cbdata;
|
||||
strcpy(newnode->i_name, name);
|
||||
strlcpy(newnode->i_name, name, sizeof(newnode->i_name));
|
||||
|
||||
/* Add the inode to the list of children inodes of the parent. */
|
||||
TAILQ_INSERT_HEAD(&parent->i_children, newnode, i_siblings);
|
||||
|
|
|
@ -114,7 +114,7 @@ static int go_down(struct inode *parent, char *name, struct inode **child)
|
|||
/*===========================================================================*
|
||||
* resolve_link *
|
||||
*===========================================================================*/
|
||||
static int resolve_link(struct inode *node, char *pptr, char *tail)
|
||||
static int resolve_link(struct inode *node, char pptr[PATH_MAX], char *tail)
|
||||
{
|
||||
/* Given a symbolic link, resolve and return the contents of the link.
|
||||
*/
|
||||
|
@ -135,9 +135,9 @@ static int resolve_link(struct inode *node, char *pptr, char *tail)
|
|||
if (len + strlen(tail) >= sizeof(path))
|
||||
return ENAMETOOLONG;
|
||||
|
||||
strcat(path, tail);
|
||||
strlcat(path, tail, sizeof(path));
|
||||
|
||||
strcpy(pptr, path);
|
||||
strlcpy(pptr, path, PATH_MAX);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ int fs_read(void)
|
|||
r = vtreefs_hooks->read_hook(node, pos, &ptr, &len,
|
||||
get_inode_cbdata(node));
|
||||
|
||||
assert(len >= 0 && len <= fs_m_in.REQ_NBYTES);
|
||||
assert(len <= fs_m_in.REQ_NBYTES);
|
||||
|
||||
/* Copy the resulting data to user space. */
|
||||
if (r == OK && len > 0) {
|
||||
|
|
Loading…
Reference in a new issue