From b140e9d2e96b1620e971fbbdb9b671e9a38825f1 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 2 Apr 2022 16:47:45 +0100 Subject: [PATCH] seems null strings may reach Parse*UniversalUserIdentifier --- OpenSim/Framework/Util.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e5ce57d3d3..9fb83d6729 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -3693,7 +3693,7 @@ namespace OpenSim.Framework { secret = string.Empty; - if (value.Length == 36) + if (value == null || value.Length == 36) { url = string.Empty; firstname = string.Empty; @@ -3776,7 +3776,7 @@ namespace OpenSim.Framework { secret = string.Empty; - if (value.Length < 38) + if (value == null || value.Length < 38) { url = string.Empty; firstname = string.Empty; @@ -3849,7 +3849,7 @@ namespace OpenSim.Framework public static unsafe bool ParseUniversalUserIdentifier(string value, out UUID uuid, out string url, out string firstname, out string lastname) { - if (value.Length == 36) + if (value == null || value.Length == 36) { url = string.Empty; firstname = string.Empty; @@ -3923,7 +3923,7 @@ namespace OpenSim.Framework public static unsafe bool ParseFullUniversalUserIdentifier(string value, out UUID uuid, out string url, out string firstname, out string lastname) { - if (value.Length < 38) + if (value == null || value.Length < 38) { url = string.Empty; firstname = string.Empty; @@ -3989,7 +3989,7 @@ namespace OpenSim.Framework public static unsafe bool ParseFullUniversalUserIdentifier(string value, out UUID uuid, out string url) { - if (value.Length < 38) + if (value == null || value.Length < 38) { url = string.Empty; uuid = UUID.Zero; @@ -4029,7 +4029,7 @@ namespace OpenSim.Framework public static unsafe bool ParseUniversalUserIdentifier(string value, out UUID uuid, out string url) { - if (value.Length < 38) + if (value == null || value.Length < 38) { url = string.Empty; uuid = UUID.Zero; @@ -4066,7 +4066,7 @@ namespace OpenSim.Framework public static unsafe bool ParseFullUniversalUserIdentifier(string value, out UUID uuid) { - if (value.Length < 38) + if (value == null || value.Length < 38) { uuid = UUID.Zero; return false; @@ -4096,7 +4096,7 @@ namespace OpenSim.Framework public static bool ParseUniversalUserIdentifier(string value, out UUID uuid) { - if (value.Length < 36) + if (value == null || value.Length < 36) { uuid = UUID.Zero; return false;