The previous test would return EFAULT as soon as the group pointer
was NULL, while it is sensible when the count is also 0.
In that case, the SETGROUP syscall is expected to clear all the
group entries as the new set is empty.
Change-Id: I07b7e1d1f023a52e3035d53f7d9b42b660e039e8
if (ngroups > NGROUPS_MAX || ngroups < 0)
return(EINVAL);
- if (m_in.groupsp == NULL)
+ if (m_in.grp_no > 0 && m_in.groupsp == NULL)
return(EFAULT);
r = sys_datacopy(who_e, (vir_bytes) m_in.groupsp, SELF,