diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2014-08-25 16:46:53 +0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-10-31 15:11:16 +0100 |
commit | 9085c3c4214282cb8fbf3024110bf5cd88999b7f (patch) | |
tree | 2a8e9f79bf4d7a42fdd96dbfa36a54bf1fc191a3 /drivers/misc | |
parent | 30063396d818b279a5571476a80db4b656d61610 (diff) |
mei: bus: fix possible boundaries violation
commit cfda2794b5afe7ce64ee9605c64bef0e56a48125 upstream.
function 'strncpy' will fill whole buffer 'id.name' of fixed size (32)
with string value and will not leave place for NULL-terminator.
Possible buffer boundaries violation in following string operations.
Replace strncpy with strlcpy.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/mei/bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index cd2033cd7120..72b682379611 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -71,7 +71,7 @@ static int mei_cl_device_probe(struct device *dev) dev_dbg(dev, "Device probe\n"); - strncpy(id.name, dev_name(dev), sizeof(id.name)); + strlcpy(id.name, dev_name(dev), sizeof(id.name)); return driver->probe(device, &id); } |