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

v0.7.x
Dario Nieuwenhuis 2021-04-07 02:37:58 +02:00
parent b7c589e371
commit b693333125
1 changed files with 1 additions and 1 deletions

View File

@ -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;