Skip to content

Commit

Permalink
ConnId: Fix hax complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Nov 4, 2024
1 parent 1ebdcfc commit e747187
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions shared/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,13 @@ impl ConnId {
}
}
s[0] = input.len() as u8 | 0x40;
s.get_mut(1..1 + input.len())?.copy_from_slice(input);
Some(Self(s))
if let Some(tail) = s.get_mut(1..1 + input.len()) {
tail.copy_from_slice(input);
Some(Self(s))
} else {
// Data too long
None
}
}
}

Expand Down

0 comments on commit e747187

Please sign in to comment.