- if (sd->owner_offset != 0)
- print_sid(p + owner_offset, T("Owner"));
- if (sd->group_offset != 0)
- print_sid(p + group_offset, T("Group"));
- if (sd->sacl_offset != 0)
- print_acl(p + sacl_offset, T("System"));
- if (sd->dacl_offset != 0)
- print_acl(p + dacl_offset, T("Discretionary"));
+ if (owner_offset != 0 && owner_offset <= size)
+ print_sid((const SID*)((const u8*)descr + owner_offset),
+ T("Owner"), size - owner_offset);
+
+ if (group_offset != 0 && group_offset <= size)
+ print_sid((const SID*)((const u8*)descr + group_offset),
+ T("Group"), size - group_offset);
+
+ if (dacl_offset != 0 && dacl_offset <= size)
+ print_acl((const ACL*)((const u8*)descr + dacl_offset),
+ T("Discretionary"), size - dacl_offset);
+
+ if (sacl_offset != 0 && sacl_offset <= size)
+ print_acl((const ACL*)((const u8*)descr + sacl_offset),
+ T("System"), size - sacl_offset);