projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b783e62
)
Btrfs: copy string correctly in INO_LOOKUP ioctl
author
Li Zefan
<lizf@cn.fujitsu.com>
Thu, 14 Jul 2011 03:16:00 +0000
(
03:16
+0000)
committer
Chris Mason
<chris.mason@oracle.com>
Mon, 1 Aug 2011 18:30:45 +0000
(14:30 -0400)
Memory areas [ptr, ptr+total_len] and [name, name+total_len]
may overlap, so it's wrong to use memcpy().
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/btrfs/ioctl.c
b/fs/btrfs/ioctl.c
index fd252fff4c6666d19ebc53553c96d17d8567d37a..2bb08862a4f6a7af63c90391f282abc9a8dc312c 100644
(file)
--- a/
fs/btrfs/ioctl.c
+++ b/
fs/btrfs/ioctl.c
@@
-1757,11
+1757,10
@@
static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
key.objectid = key.offset;
key.offset = (u64)-1;
dirid = key.objectid;
-
}
if (ptr < name)
goto out;
- mem
cpy
(name, ptr, total_len);
+ mem
move
(name, ptr, total_len);
name[total_len]='\0';
ret = 0;
out: