Skip to content

Commit

Permalink
fix principal length check (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyan-dfinity authored May 3, 2024
1 parent ae4d0f7 commit d2654f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/candid/src/binary_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub struct Len(
pub struct PrincipalBytes {
#[br(assert(flag == 1u8, "Opaque reference not supported"))]
pub flag: u8,
#[br(parse_with = read_leb)]
#[br(parse_with = read_leb, assert(len <= 29, "Principal is longer than 29 bytes"))]
pub len: u64,
#[br(count = len)]
pub inner: Vec<u8>,
Expand Down

0 comments on commit d2654f9

Please sign in to comment.