-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Go] Perform empty string check on string fields when packing objects #7719
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
c++
codegen
Involving generating code from schema
golang
labels
Dec 18, 2022
le-michael
changed the title
[Go] Perform nil check on string fields when packing object api
[Go] Perform empty string check on string fields when packing objects
Dec 18, 2022
dbaileychess
approved these changes
Dec 22, 2022
sunwen18
pushed a commit
to sunwen18/flatbuffers
that referenced
this pull request
Dec 25, 2022
Co-authored-by: Derek Bailey <derekbailey@google.com>
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Sep 23, 2024
In C++, CreateX allows to write the default "" value of a required string, when the string is not explicitly set. Object API Pack method uses this implementation of CreateX. However, in go, despite whether the field is optional or required, it is always checked against empty string allowing to create messages that fail to pass the verifier. This commits partially reverts flatbuffers/google#7719 when the string field is required.
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Sep 24, 2024
In C++, CreateX allows to write the default "" value of a required string, when the string is not explicitly set. Object API Pack method uses this implementation of CreateX. However, in go, despite whether the field is optional or required, it is always checked against empty string allowing to create messages that fail to pass the verifier. This commits partially reverts google#7719 when the string field is required.
jochenparm
pushed a commit
to jochenparm/flatbuffers
that referenced
this pull request
Oct 29, 2024
Co-authored-by: Derek Bailey <derekbailey@google.com>
jochenparm
pushed a commit
to jochenparm/flatbuffers
that referenced
this pull request
Oct 29, 2024
Co-authored-by: Derek Bailey <derekbailey@google.com>
razvanalex
added a commit
to razvanalex/flatbuffers
that referenced
this pull request
Dec 3, 2024
In C++, CreateX allows to write the default "" value of a required string, when the string is not explicitly set. Object API Pack method uses this implementation of CreateX. However, in go, despite whether the field is optional or required, it is always checked against empty string allowing to create messages that fail to pass the verifier. This commits partially reverts google#7719 when the string field is required.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7709