Repository navigation
Validate lengths and values when reading - #3
Merged
Merged
Conversation
* Let custom serializers declare a minimum value size * Update docs to match new crap * More null stuff * Throw for malformed values and mismatched types * oops * Count string memory toward the per-call allocation budget * To the best of my knowledge nothing in Robust uses this, but it's still an issue... * Count collection memory across the whole deserialize call * Add tests for truncated byte-sized reads * Limit memory used by collection elements * Dump unmaintained code * We don't use this for Robust, and we have no good way of ensuring it meets standards. As such, it's better and simpler to drop maintaining all of this... * Reject string character counts that don't match the decoded text * Harden against oveallocation
Member
Author
|
Welp this won't ever get reviewed |
VasilisThePikachu
approved these changes
Nov 6, 2026
Axionyxx
added a commit
that referenced
this pull request
Nov 6, 2026
* Squash commits * Let custom serializers declare a minimum value size * Update docs to match new crap * More null stuff * Throw for malformed values and mismatched types * oops * Count string memory toward the per-call allocation budget * To the best of my knowledge nothing in Robust uses this, but it's still an issue... * Count collection memory across the whole deserialize call * Add tests for truncated byte-sized reads * Limit memory used by collection elements * Dump unmaintained code * We don't use this for Robust, and we have no good way of ensuring it meets standards. As such, it's better and simpler to drop maintaining all of this... * Reject string character counts that don't match the decoded text * Harden against oveallocation * Shut up tests (cherry picked from commit 1eb828a)
Axionyxx
added a commit
that referenced
this pull request
Nov 6, 2026
* Squash commits * Let custom serializers declare a minimum value size * Update docs to match new crap * More null stuff * Throw for malformed values and mismatched types * oops * Count string memory toward the per-call allocation budget * To the best of my knowledge nothing in Robust uses this, but it's still an issue... * Count collection memory across the whole deserialize call * Add tests for truncated byte-sized reads * Limit memory used by collection elements * Dump unmaintained code * We don't use this for Robust, and we have no good way of ensuring it meets standards. As such, it's better and simpler to drop maintaining all of this... * Reject string character counts that don't match the decoded text * Harden against oveallocation * Shut up tests (cherry picked from commit 1eb828a)
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.
MaxCollectionLengthandMaxCollectionBytessettings.InvalidDataExceptionfor malformed values and mismatched types.IMinimumSerializedSizeso custom serializers can opt in to the length check.Reads over the new limits will throw and explode the client connection probably.
Tested with (new) unit files, as well as against SS14 master with a single player in a release build. I'd really prefer to be able to test this before it hits robust toolbox master though, but that can be done after its merged here so I can make a RC or something