Correct mostly harmless off-by-one error in getdomainname().

Reviewed by:	imp
This commit is contained in:
Jacques Vidrine 2003-09-13 17:12:22 +00:00
parent 2411c9502d
commit b5e80ae344

View File

@ -275,8 +275,8 @@ getdomainname(td, uap)
mtx_lock(&Giant);
domainnamelen = strlen(domainname) + 1;
if ((u_int)uap->len > domainnamelen + 1)
uap->len = domainnamelen + 1;
if ((u_int)uap->len > domainnamelen)
uap->len = domainnamelen;
error = copyout(domainname, uap->domainname, uap->len);
mtx_unlock(&Giant);
return (error);