summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2012-11-14 10:32:12 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2012-11-14 10:32:12 +0000
commit6f68699fbdfe7d154a78eb8c621286d23637d951 (patch)
tree6622b8a3a2923d75167b1e4a90d089054f5b8eee
parent23454ad0e2546b539150e96f2622f57ba1be13fb (diff)
Notes
-rw-r--r--sys/kern/kern_prot.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 53af7935e179..951c640b519a 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -2084,6 +2084,8 @@ sys_getlogin(struct thread *td, struct getlogin_args *uap)
bcopy(p->p_session->s_login, login, uap->namelen);
SESS_UNLOCK(p->p_session);
PROC_UNLOCK(p);
+ if (strlen(login) + 1 > uap->namelen)
+ return (ERANGE);
error = copyout(login, uap->namebuf, uap->namelen);
return(error);
}