[Dart] Actually use resized FlexBuffers buffer#8929
Open
greenrobot-team wants to merge 1 commit intogoogle:masterfrom
Open
[Dart] Actually use resized FlexBuffers buffer#8929greenrobot-team wants to merge 1 commit intogoogle:masterfrom
greenrobot-team wants to merge 1 commit intogoogle:masterfrom
Conversation
When building a FlexBuffer using the Builder and adding data that exceeds the default buffer size (2048 bytes), in _newOffset() a larger buffer is created, but never used. This results in a RangeError. Resolve by actually replacing the too small with the new larger buffer. Add a test that verifies this by adding multiple large strings to a vector.
This file contains hidden or 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
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.
When building a FlexBuffer using the Dart Builder API and adding data that exceeds the default buffer size (2048 bytes), in the _newOffset() method a larger buffer is created, but never used. This results in a RangeError.
Resolve by actually replacing the too small with the new larger buffer. Add a test that verifies this by adding multiple large strings to a vector.
This was originally reported to us by a user, so additional details can be found in objectbox/objectbox-dart#786 (note that for the reporter the data written that exceeds the buffer size is an integer and in my test a string, so the stack traces and error messages vary slightly).