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);
/*===========================================================================*
* 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.
*/
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;
}
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) {