Skip to content

Commit

Permalink
fix(addresses): relax length check during parsing (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jul 19, 2024
1 parent 5d00e2c commit c7f2240
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pallas-addresses/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ macro_rules! parse_shelley_fn {
};
($name:tt, $payment:tt) => {
fn $name(header: u8, payload: &[u8]) -> Result<Address, Error> {
if payload.len() != 28 {
if payload.len() < 28 {
return Err(Error::InvalidAddressLength(payload.len()));
}

Expand All @@ -370,7 +370,7 @@ macro_rules! parse_shelley_fn {
macro_rules! parse_stake_fn {
($name:tt, $type:tt) => {
fn $name(header: u8, payload: &[u8]) -> Result<Address, Error> {
if payload.len() != 28 {
if payload.len() < 28 {
return Err(Error::InvalidAddressLength(payload.len()));
}

Expand Down

0 comments on commit c7f2240

Please sign in to comment.