Merge branch 'safe_u16_conversion' into 'main'
tor-cell: Consistent and secure conversion to u16 See merge request tpo/core/arti!803
This commit is contained in:
commit
49ffb1cf4b
|
@ -194,7 +194,7 @@ impl msg::Body for EstablishIntro {
|
|||
}
|
||||
|
||||
w.write_all(&self.handshake_auth[..]);
|
||||
w.write_u16(self.sig.len() as u16);
|
||||
w.write_u16(u16::try_from(self.sig.len()).map_err(|_| EncodeError::BadLengthValue)?);
|
||||
w.write_all(&self.sig[..]);
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue