am d55d8dac: Merge "prevent ioctl_init() to write outside buffer"

* commit 'd55d8dac45dc60cb2cc9e599d3e89532db0cfc39':
  prevent ioctl_init() to write outside buffer
This commit is contained in:
Elliott Hughes 2015-02-07 07:38:37 +00:00 committed by Android Git Automerger
commit 33b6de4b94

View file

@ -333,7 +333,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) {
strncpy(io->name, name, sizeof(io->name));
strlcpy(io->name, name, sizeof(io->name));
}
}