Skip to content

Commit e1442c7

Browse files
fix(s2n-quic-dc): Fix use-after-drop in Pool::grow() race-loser path (#3088)
1 parent f70563e commit e1442c7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • dc/s2n-quic-dc/src/stream/recv/dispatch

dc/s2n-quic-dc/src/stream/recv/dispatch/pool.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ where
144144
// update our local copy
145145
self.epoch = senders.epoch;
146146

147-
// free what we just allocated, since we raced with the other pool instance
147+
// Drop senders first since their drop impl accesses the descriptor's fields
148+
drop(pending_senders);
149+
150+
// Now it's safe to destroy the descriptors
148151
for desc in pending_desc {
149152
unsafe {
150153
desc.drop_in_place();

0 commit comments

Comments
 (0)