(struct auth_SidAttr) {} makes sure we don't leave uninitialized
memory in case struct auth_SidAttr will change (which will happen in
the next commits).
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
{
struct auth_SidAttr *tmp = NULL;
+ if (sid == NULL) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
if ((*num) == UINT32_MAX) {
return NT_STATUS_INTEGER_OVERFLOW;
}
}
*sids = tmp;
- sid_copy(&((*sids)[*num].sid), sid);
- (*sids)[*num].attrs = attrs;
+ (*sids)[*num] = (struct auth_SidAttr) {
+ .sid = *sid,
+ .attrs = attrs,
+ };
*num += 1;
return NT_STATUS_OK;