Fix unreleased cache buffer in QUIC sniffing #3320
Merged
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.
May address #3316
In the issue report, witness two byte slices's addresses provided to
seal
:The dst's address is 0xc001567012, the plain text's address is 0xc001567000.
The dst's code is:
v2ray-core/common/crypto/auth.go
Lines 264 to 269 in 14bc04a
The plain text's code is:
v2ray-core/common/crypto/auth.go
Lines 295 to 304 in 14bc04a
Apparently,
eb
andtemp
are pointing to the same buffer. It meansbuf.New()
returns a buffer twice.So I found issue in QUIC sniffing in this PR:
All but last buffers assigned to
cache
will not be released if looping more than once. It may overflow the pool and makebuf.New()
works incorrectly.