Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfda2794 authored by Alexander Usyskin's avatar Alexander Usyskin Committed by Greg Kroah-Hartman
Browse files

mei: bus: fix possible boundaries violation



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.

Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: default avatarAlexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 154eb18f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,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);
}