Visitar URL original
[csharp] ByteString.CreateCodedInput should use ArraySegment offset and count by kiwidev · Pull Request #8740 · protocolbuffers/protobuf · GitHub
Skip to content

[csharp] ByteString.CreateCodedInput should use ArraySegment offset and count - #8740

Merged
jtattermusch merged 1 commit into
protocolbuffers:masterfrom
kiwidev:master
Jun 18, 2021
Merged

jtattermusch merged 1 commit into
protocolbuffers:masterfrom
kiwidev:master

Conversation

@kiwidev

@kiwidev kiwidev commented Jun 16, 2021 •

Copy link
Copy Markdown
Contributor

CreateCodedInput is created from the underlying array behind the ByteString.
If this was created from a larger array (via Memory or ArrayPool etc)
then the CodedInput refers to the wrong section of memory.

Change is to add the offset and count like the other methods that use the
ArraySegment (ToString, ToBase64, WriteTo).

Fixup for #7645

…nd count

CreateCodedInput is created from the underlying array behind the ByteString.
If this was created from a larger array (via Memory<byte> or ArrayPool etc)
then the CodedInput refers to the wrong section of memory.

Change is to add the offset and count like the other methods that use the
ArraySegment (ToString, ToBase64, WriteTo).
@JamesNK

JamesNK commented Jun 18, 2021

Copy link
Copy Markdown
Contributor

@jtattermusch

@jtattermusch jtattermusch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@jtattermusch
jtattermusch merged commit 071b161 into protocolbuffers:master Jun 18, 2021
@kiwidev

kiwidev commented Jun 18, 2021

Copy link
Copy Markdown
Contributor Author

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants