From 1bcdaa94efa4f00a6a654d0c17fd8a6d99fffa82 Mon Sep 17 00:00:00 2001 From: "OpenGenesis (MPL 2.0)" <153564363+opengenesislink@users.noreply.github.com> Date: Mon, 12 Oct 2026 23:18:37 +0200 Subject: [PATCH] fix(ogl): guard null attachment list and compare configured starter model names safely --- .../Services/UserAccountService/UserAccountService.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 831061d0..657ea898 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -785,9 +785,12 @@ namespace OpenSim.Services.UserAccountService } } - foreach (AvatarAttachment attachment in appearance.GetAttachments()) + List attachments = appearance.GetAttachments(); + if (attachments == null) + return false; + foreach (AvatarAttachment attachment in attachments) { - if (!ValidateOglStarterItem(owner, attachment.ItemID)) + if (attachment == null || !ValidateOglStarterItem(owner, attachment.ItemID)) return false; } return true; @@ -996,7 +999,8 @@ namespace OpenSim.Services.UserAccountService // Recheck immediately before copying to narrow the window in which // a model owner could revoke permissions after registration preflight. if (m_OglStarterTemplatesEnabled && - (model == m_OglBenjaminTemplate || model == m_OglLunaTemplate) && + (string.Equals(model, m_OglBenjaminTemplate, StringComparison.Ordinal) || + string.Equals(model, m_OglLunaTemplate, StringComparison.Ordinal)) && !ValidateOglStarterItems(modelAccount.PrincipalID, modelAppearance)) throw new InvalidOperationException("Starter outfit changed or is not transferable");