Fix overlapping range in compactsize encoding.

This commit is contained in:
Henry de Valence 2019-11-19 16:51:11 -08:00 committed by Deirdre Connolly
parent ca24aaf58e
commit 986b5ee46b
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ pub trait WriteZcashExt: io::Write {
fn write_compactsize(&mut self, n: u64) -> io::Result<()> {
match n {
0x0000_0000..=0x0000_00fc => self.write_u8(n as u8),
0x0000_00fd..=0x0001_0000 => {
0x0000_00fd..=0x0000_ffff => {
self.write_u8(0xfd)?;
self.write_u16::<LittleEndian>(n as u16)
}