You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The sort_by function in the collect method of FragmentQueue is using id for comparison during sorting (it should actually be index), causing the Frame to be sorted incorrectly. As a result, in some instances, the output Vec<u8> may be incorrect.
To Reproduce
Steps to reproduce the behavior:
This issue may probabilistically occur when receiving a Fragment because the sorting is not done correctly, primarily due to the improper use of id instead of index in the sorting process.
Expected behavior
Correcting the usage of the sort_by function, here is the suggested modified code:
Additional context
Here is the debug output of my code, and the buffer concatenation is not correct:
code:
for frame in frames.iter() {
let fm = frame.fragment_meta.clone().unwrap();
println!("index: {}, len: {}", fm.index, frame.body.len());
buffer.extend_from_slice(&frame.body);
}
Do you have a input buffer source or no? If not, judging the frame length and indices im assuming this is a MC buffer source.
john-bv
added
Complete
The code review for this issue has been completed; and is now being finalized.
and removed
Unconfirmed
This bug/issue has not been confirmed yet
In Progress
We are working on this
labels
Jan 26, 2024
Describe the bug
The
sort_by
function in the collect method ofFragmentQueue
is usingid
for comparison during sorting (it should actually beindex
), causing theFrame
to be sorted incorrectly. As a result, in some instances, the outputVec<u8>
may be incorrect.To Reproduce
Steps to reproduce the behavior:
This issue may probabilistically occur when receiving a
Fragment
because the sorting is not done correctly, primarily due to the improper use ofid
instead ofindex
in the sorting process.Expected behavior
Correcting the usage of the
sort_by
function, here is the suggested modified code:Server versions (please complete the following information):
Additional context
Here is the debug output of my code, and the buffer concatenation is not correct:
code:
output:
The text was updated successfully, but these errors were encountered: