From 964ca0caeeefeb4bfcaefffb86dfbd8f55832697 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Mon, 3 Mar 1997 10:15:48 +0000 Subject: [PATCH] Use MAXLOGNAME for stricter size check in setlogin() syscall instead of sizeof of padded s_login array --- sys/kern/kern_prot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index b3906ea2443c..61dd4be3a592 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$ + * $Id: kern_prot.c,v 1.23 1997/02/22 09:39:09 peter Exp $ */ /* @@ -683,7 +683,7 @@ setlogin(p, uap, retval) int *retval; { int error; - char logintmp[sizeof(p->p_pgrp->pg_session->s_login)]; + char logintmp[MAXLOGNAME]; if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); @@ -693,6 +693,6 @@ setlogin(p, uap, retval) error = EINVAL; else if (!error) (void) memcpy(p->p_pgrp->pg_session->s_login, logintmp, - sizeof(p->p_pgrp->pg_session->s_login)); + sizeof(logintmp)); return (error); }