浏览代码

hostfs: dumb (and usually harmless) tpyo - strncpy instead of strlcpy

... not harmless in this case - we have a string in the end of buffer
already.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 15 年之前
父节点
当前提交
850a496f96
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/hostfs/hostfs_kern.c

+ 1 - 1
fs/hostfs/hostfs_kern.c

@@ -104,7 +104,7 @@ static char *__dentry_name(struct dentry *dentry, char *name)
 		__putname(name);
 		return NULL;
 	}
-	strncpy(name, root, PATH_MAX);
+	strlcpy(name, root, PATH_MAX);
 	if (len > p - name) {
 		__putname(name);
 		return NULL;