mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-08 13:19:10 +00:00
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:
co-authored by
Björn Harrtell
Wouter van Oortmerssen
parent
35230bd70c
commit
a6b337f803
@@ -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