diff --git a/server/shadow/shadow_subsystem_builtin.c b/server/shadow/shadow_subsystem_builtin.c index b9ee9c967..627458ec0 100644 --- a/server/shadow/shadow_subsystem_builtin.c +++ b/server/shadow/shadow_subsystem_builtin.c @@ -40,9 +40,9 @@ static pfnShadowSubsystemEntry shadow_subsystem_load_static_entry(const char* na { if (!name) { - for (size_t index = 0; index < g_SubsystemCount; index++) + if (g_SubsystemCount > 0) { - const RDP_SHADOW_SUBSYSTEM* cur = &g_Subsystems[index]; + const RDP_SHADOW_SUBSYSTEM* cur = &g_Subsystems[0]; WINPR_ASSERT(cur->entry); return cur->entry;