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

This commit is contained in:
Dario Nieuwenhuis 2021-04-07 02:37:58 +02:00
parent 32cf4befd0
commit 17cf2c8d47

View File

@ -297,7 +297,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;