Make sure dev.name is always nul-terminated

This commit is contained in:
Johan Hedberg 2009-06-30 15:50:58 +03:00
parent cd6e797fde
commit fa006cfb6f

View File

@ -562,7 +562,7 @@ static int uinput_create(char *name)
memset(&dev, 0, sizeof(dev));
if (name)
strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE);
strncpy(dev.name, name, UINPUT_MAX_NAME_SIZE - 1);
dev.id.bustype = BUS_BLUETOOTH;
dev.id.vendor = 0x0000;