}
current_token = session_info->security_token;
- if (current_token == NULL) {
- return NT_STATUS_INVALID_HANDLE;
- }
-
- if (current_token->num_sids > PRIMARY_USER_SID_INDEX) {
- current_sid = ¤t_token->sids[PRIMARY_USER_SID_INDEX];
- }
-
- if (current_sid == NULL) {
+ if ((current_token == NULL) ||
+ (current_token->num_sids <= PRIMARY_USER_SID_INDEX)) {
return NT_STATUS_INVALID_HANDLE;
}
+ current_sid = ¤t_token->sids[PRIMARY_USER_SID_INDEX];
if (table->local.num_opens >= table->local.max_opens) {
return NT_STATUS_INSUFFICIENT_RESOURCES;