diff options
author | ache <ache@FreeBSD.org> | 1997-03-03 22:46:16 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1997-03-03 22:46:16 +0000 |
commit | a06fb05366f1144206831bdc1652de0fa5d09bec (patch) | |
tree | ee512ad5765307b494a6293d4d83793fc86f6d7c /sys | |
parent | 4f809e5a27e91a388c8900db84772044168b5e76 (diff) | |
download | FreeBSD-src-a06fb05366f1144206831bdc1652de0fa5d09bec.zip FreeBSD-src-a06fb05366f1144206831bdc1652de0fa5d09bec.tar.gz |
Don't copy more than MAXLOGNAME bytes in getlogin() syscall,
it is stricter than padded s_login size check was there.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_prot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 61dd4be..f7d026c 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_prot.c,v 1.23 1997/02/22 09:39:09 peter Exp $ + * $Id: kern_prot.c,v 1.24 1997/03/03 10:15:48 ache Exp $ */ /* @@ -661,8 +661,8 @@ getlogin(p, uap, retval) int *retval; { - if (uap->namelen > sizeof (p->p_pgrp->pg_session->s_login)) - uap->namelen = sizeof (p->p_pgrp->pg_session->s_login); + if (uap->namelen > MAXLOGNAME) + uap->namelen = MAXLOGNAME); return (copyout((caddr_t) p->p_pgrp->pg_session->s_login, (caddr_t) uap->namebuf, uap->namelen)); } |