| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
This fixes an edge case scenario with string reading where if user code has caused the character count to have been already read prior to attempting to read a string value (safely or unsafely) and then reading the string can result in the signed integer size to roll over to a negative value and thus causing the reader to attempt to read into restricted memory outside of the application domain which results in the editor crashing. The fix catches this scenario and throws an overflow exception prior to attempting to read into negative memory space relative to the application domain.
There was a problem hiding this comment.
Thanks for the investigation on this!
Sorry, something went wrong.
There was a problem hiding this comment.
Added a couple nitpick comments that might help with readability/maintenance, feel free to ignore them.
Apart from that LGTM!
Sorry, something went wrong.
…Reader.cs Co-authored-by: Emma <emma.mcmillan@unity3d.com>
…w' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/fastbufferreader-string-deserialization-int-overflow
…lization-int-overflow
| Back | FazBrowse Home | New Git URL |
Purpose of this PR
This PR resolves an edge case scenario that can cause the Unity editor to crash.
The issue requires a portion of the character count of a serialized string to have been read prior to attempting to safely or unsafely read the string. When using 2 byte character values, this can result in the length exceeding the maximum integer size resulting in a negative size being read which, in turn, causes the FastBufferReader to attempt to read into restricted memory (most likely outside of the application domain) that results in a hard editor crash.
Jira ticket
UUM-145752
Changelog
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Automated tests:
Does the change require QA team to:
If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Backports
No back port is required.