Check the return type of t2h_freebsd_acl_type so we don't use garbage.

Signed-off-by: Warner Losh <[email protected]>
---
 bsd-user/freebsd/os-extattr.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bsd-user/freebsd/os-extattr.h b/bsd-user/freebsd/os-extattr.h
index 0414a2e479..97c0f76559 100644
--- a/bsd-user/freebsd/os-extattr.h
+++ b/bsd-user/freebsd/os-extattr.h
@@ -407,6 +407,9 @@ static inline abi_long 
do_freebsd__acl_aclcheck_file(abi_ulong arg1,
     acl_type_t type;
 
     ret = t2h_freebsd_acl_type(&type, arg2);
+    if (is_error(ret)) {
+        return ret;
+    }
     p = lock_user_string(arg1);
     if (p == NULL) {
         return -TARGET_EFAULT;

-- 
2.52.0


Reply via email to