Skip to content

api: Early-detect null bytes from Metadata.Marshaller #9781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 6, 2023

Conversation

ejona86
Copy link
Member

@ejona86 ejona86 commented Jan 3, 2023

See #9706

@ejona86 ejona86 requested a review from sanjaypujare January 3, 2023 19:19
@sanjaypujare
Copy link
Contributor

How about adding the same checks to

  • AsciiKey.toBytes() line 982
  • TrustedAsciiKey.toBytes() line 1007

Copy link
Contributor

@sanjaypujare sanjaypujare left a comment

Choose a reason for hiding this comment

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

Found 2 places where the check can potentially be added

@ejona86
Copy link
Member Author

ejona86 commented Jan 5, 2023

I had seen both of those places and didn't care. The first will already NPE and the second is fairly safe. It would be good to fix the second to avoid needing to consider the case, and I might as well be consistent with the error message for the first.

@ejona86 ejona86 requested a review from sanjaypujare January 5, 2023 22:25
Copy link
Contributor

@sanjaypujare sanjaypujare left a comment

Choose a reason for hiding this comment

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

LGTM

@ejona86 ejona86 merged commit cc53784 into grpc:master Jan 6, 2023
@ejona86 ejona86 deleted the metadata-earlier-npe branch January 6, 2023 01:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants