diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-06 13:09:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-06 13:09:14 +0000 |
commit | ddd278320449ef4a3f57d78fc1dedfe3927d18df (patch) | |
tree | 620e664e675f3ade3d5f3944d6f70f484c125c99 /sys/kern | |
parent | d3bded9426513cb390446aa22bb43bdc0e9d8129 (diff) |
terminate copyinstr, copyoutstr full name; Don.Lewis@tsc.tdk.com
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_lkm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_lkm.c b/sys/kern/kern_lkm.c index 00b9141313a..c415c7193fd 100644 --- a/sys/kern/kern_lkm.c +++ b/sys/kern/kern_lkm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lkm.c,v 1.13 1996/10/14 13:01:33 mickey Exp $ */ +/* $OpenBSD: kern_lkm.c,v 1.14 1997/02/06 13:09:13 deraadt Exp $ */ /* $NetBSD: kern_lkm.c,v 1.31 1996/03/31 21:40:27 christos Exp $ */ /* @@ -207,9 +207,10 @@ lkmlookup(i, name, error) * Copy name and lookup id from all loaded * modules. May fail. */ - *error = copyinstr(name, istr, MAXLKMNAME, NULL); + *error = copyinstr(name, istr, MAXLKMNAME-1, NULL); if (*error) return NULL; + istr[MAXLKMNAME-1] = '\0'; for (p = lkmods.tqh_first; p != NULL; p = p->list.tqe_next) if (!strcmp(istr, p->private.lkm_any->lkm_name)) @@ -542,7 +543,7 @@ lkmioctl(dev, cmd, data, flag, p) statp->private = (unsigned long)curp->private.lkm_any; statp->ver = curp->private.lkm_any->lkm_ver; copyoutstr(curp->private.lkm_any->lkm_name, - statp->name, MAXLKMNAME - 2, NULL); + statp->name, MAXLKMNAME, NULL); break; |