Browse Source

phy: fix FaultInjector returning a too big buffer when simulating a drop on tx

Dario Nieuwenhuis 4 years ago
parent
commit
f3c6ec5cf8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/phy/fault_injector.rs

+ 1 - 1
src/phy/fault_injector.rs

@@ -295,7 +295,7 @@ impl<'a, Tx: phy::TxToken> phy::TxToken for TxToken<'a, Tx> {
         };
 
         if drop {
-            return f(&mut self.junk);
+            return f(&mut self.junk[..len]);
         }
 
         let Self { token, state, config, .. } = self;