From ddd278320449ef4a3f57d78fc1dedfe3927d18df Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Thu, 6 Feb 1997 13:09:14 +0000 Subject: terminate copyinstr, copyoutstr full name; Don.Lewis@tsc.tdk.com --- sys/kern/kern_lkm.c | 7 ++++--- 1 file 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; -- cgit v1.2.3