Correct mostly harmless off-by-one error in getdomainname().
Reviewed by: imp
This commit is contained in:
parent
2411c9502d
commit
b5e80ae344
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user