vt(4): Use strncpy() to copy into a fixed-size buffer
CID: 1230007 MFC after: 3 days
This commit is contained in:
parent
cd3caa0d35
commit
ec4f1f2cda
@ -796,7 +796,8 @@ vt_allocate_keyboard(struct vt_device *vd)
|
||||
continue;
|
||||
|
||||
bzero(&ki, sizeof(ki));
|
||||
strcpy(ki.kb_name, k->kb_name);
|
||||
strncpy(ki.kb_name, k->kb_name, sizeof(ki.kb_name));
|
||||
ki.kb_name[sizeof(ki.kb_name) - 1] = '\0';
|
||||
ki.kb_unit = k->kb_unit;
|
||||
|
||||
kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki);
|
||||
|
Loading…
Reference in New Issue
Block a user