forked from BigfootDev/flatbuffers
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>
This commit is contained in:
@@ -693,6 +693,7 @@ namespace Google.FlatBuffers
|
||||
#if ENABLE_SPAN_T && UNSAFE_BYTEBUFFER
|
||||
public unsafe string GetStringUTF8(int startPos, int len)
|
||||
{
|
||||
AssertOffsetAndLength(startPos, len);
|
||||
fixed (byte* buffer = &MemoryMarshal.GetReference(_buffer.ReadOnlySpan.Slice(startPos)))
|
||||
{
|
||||
return Encoding.UTF8.GetString(buffer, len);
|
||||
|
||||
Reference in New Issue
Block a user