Fix linux_stat

This commit is contained in:
EnderIce2 2024-03-25 22:30:59 +02:00
parent a8333048c8
commit 954e5a2d02
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -150,7 +150,11 @@ static int linux_stat(SysFrm *, const char *pathname, struct stat *statbuf)
if (pPathname == nullptr)
return -EFAULT;
return fdt->_stat(pPathname, statbuf);
auto pStatbuf = vma->UserCheckAndGetAddress(statbuf);
if (pStatbuf == nullptr)
return -EFAULT;
return fdt->_stat(pPathname, pStatbuf);
}
/* https://man7.org/linux/man-pages/man2/fstat.2.html */