summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt
diff options
context:
space:
mode:
authordumbbell <dumbbell@FreeBSD.org>2014-09-18 13:24:06 +0000
committerdumbbell <dumbbell@FreeBSD.org>2014-09-18 13:24:06 +0000
commitec4f1f2cda63931d3a7ef0214cce8c0bd80f3f98 (patch)
treeade4ba6c87a8832f44a1113c6e00f8e44f1dcb8d /sys/dev/vt
parentcd3caa0d35fe107d128d541dd1f0af765e8134c5 (diff)
downloadFreeBSD-src-ec4f1f2cda63931d3a7ef0214cce8c0bd80f3f98.zip
FreeBSD-src-ec4f1f2cda63931d3a7ef0214cce8c0bd80f3f98.tar.gz
vt(4): Use strncpy() to copy into a fixed-size buffer
CID: 1230007 MFC after: 3 days
Diffstat (limited to 'sys/dev/vt')
-rw-r--r--sys/dev/vt/vt_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c
index 62e5c48..f9e6b25 100644
--- a/sys/dev/vt/vt_core.c
+++ b/sys/dev/vt/vt_core.c
@@ -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);
OpenPOWER on IntegriCloud