Fix NULL pointer dereference in freebsd4_getfsstat. [EN-18:10.syscall]

Reported by:	Thomas Barabosch, Fraunhofer FKIE
Approved by:	so
Security:	FreeBSD-EN-18:10.syscall
Security:	CVE-2018-17154
This commit is contained in:
gordon 2018-09-27 18:32:14 +00:00 committed by Franco Fichtner
parent c0c9a2d80a
commit 8eaf017b4e

View file

@ -643,6 +643,8 @@ freebsd4_getfsstat(td, uap)
size = count * sizeof(struct statfs);
error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE,
uap->mode);
if (buf == NULL)
return (EINVAL);
td->td_retval[0] = count;
if (size != 0) {
sp = buf;