-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor encoding replicated stream messages to properly enforce fram…
…ing (#6052) This PR fixes two bugs in `encodeStreamMsgAllowCompress`: * The boundary lengths could have overflowed when casting potentially large values down to uint16 or uint32 and we wouldn't have noticed; * We would then copy in the subject/reply/header/msg with the original length regardless, not the overflowed length, meaning the decoding side would have the wrong boundaries. Now we will correctly calculate the bounds, avoiding overflows, and only append as many bytes as we clipped down to. Signed-off-by: Neil Twigg <neil@nats.io>
- Loading branch information
Showing
1 changed file
with
28 additions
and
36 deletions.
There are no files selected for viewing
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