freebsd32: Report errors when copying out oldlenp in __sysctl

This matches the native implementation's behaviour.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43101
This commit is contained in:
Mark Johnston 2023-12-25 20:37:32 -05:00
parent 711880597c
commit 81eb7baa69

View file

@ -2675,9 +2675,9 @@ freebsd32___sysctl(struct thread *td, struct freebsd32___sysctl_args *uap)
uap->new, uap->newlen, &j, SCTL_MASK32);
if (error)
return (error);
if (uap->oldlenp)
suword32(uap->oldlenp, j);
return (0);
if (uap->oldlenp != NULL && suword32(uap->oldlenp, j) != 0)
error = EFAULT;
return (error);
}
int