Skip to content

Commit a6b337f

Browse files
CurtHagenlocherbjornharrtellaardappel
authored
Add bounds checking to a method where it was missing (#8673)
Co-authored-by: Björn Harrtell <bjornharrtell@users.noreply.github.com> Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
1 parent 35230bd commit a6b337f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/FlatBuffers/ByteBuffer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ public byte Get(int index)
693693
#if ENABLE_SPAN_T && UNSAFE_BYTEBUFFER
694694
public unsafe string GetStringUTF8(int startPos, int len)
695695
{
696+
AssertOffsetAndLength(startPos, len);
696697
fixed (byte* buffer = &MemoryMarshal.GetReference(_buffer.ReadOnlySpan.Slice(startPos)))
697698
{
698699
return Encoding.UTF8.GetString(buffer, len);

0 commit comments

Comments
 (0)