OSDN Git Service
(root)
/
android-x86
/
system-vold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f3b2637
)
prevent ioctl_init() to write outside buffer
author
Marek Pola
<marek.pola@sonymobile.com>
Thu, 5 Feb 2015 13:22:34 +0000
(14:22 +0100)
committer
Henrik Baard
<henrik.baard@sonymobile.com>
Fri, 6 Feb 2015 07:01:43 +0000
(08:01 +0100)
The strncpy operation does not write a 0 termination
if the name is larger than the target buffer.
Ensure that zero termination is always written using
safe strlcpy function.
Change-Id: Idb68cdff7cd1a860c1dfac7494fa99f3d382cb91
cryptfs.c
patch
|
blob
|
history
diff --git
a/cryptfs.c
b/cryptfs.c
index
aaa2b86
..
f45a200
100644
(file)
--- a/
cryptfs.c
+++ b/
cryptfs.c
@@
-326,7
+326,7
@@
static void ioctl_init(struct dm_ioctl *io, size_t dataSize, const char *name, u
io->version[2] = 0;
io->flags = flags;
if (name) {
- str
n
cpy(io->name, name, sizeof(io->name));
+ str
l
cpy(io->name, name, sizeof(io->name));
}
}