From e1d5892f78005cf2fdbc7efcb6f585959a029914 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 13 Feb 2020 00:38:02 +0000 Subject: [PATCH] notecards text len is in bytes not chars --- OpenSim/Framework/SLUtil.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index 33e40e6969..065822a259 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs @@ -669,7 +669,12 @@ namespace OpenSim.Framework return new string[0]; indx = end + 1; - textLen += indx; + if (textLen + indx > data.Length) + return new string[0]; + // yeackk + note = Util.UTF8.GetString(data, indx, textLen); + textLen = note.Length; + indx = 0; var lines = new List(); while (indx < textLen) { @@ -681,6 +686,7 @@ namespace OpenSim.Framework lines.Add(note.Substring(indx, end - indx)); indx = end + 1; } + // notes only seem to have one text section if(lines.Count == 0) return new string[0];