Skip to content

Commit

Permalink
Fix In some cases, pkt_num_offset greater than left can cause a panic
Browse files Browse the repository at this point in the history
  • Loading branch information
majiange committed Nov 15, 2024
1 parent fc61211 commit 9bad9de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/connection/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ impl Connection {
}

// Encode packet number
let len = packet::encode_packet_num(pkt_num, pkt_num_len, &mut out[pkt_num_offset..left])?;
let len = packet::encode_packet_num(pkt_num, pkt_num_len, &mut out[pkt_num_offset..])?;
let payload_offset = pkt_num_offset + len;

// Write frames into the packet payload
Expand Down

0 comments on commit 9bad9de

Please sign in to comment.