Skip to content

Commit

Permalink
Validate destination_len argument in serialize_shard().
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmcnally committed Aug 13, 2021
1 parent e5131c0 commit 3c73b09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ static size_t serialize_shard(
uint8_t *destination,
size_t destination_len) {

if(destination_len < METADATA_LENGTH_BYTES) {
return SSKR_ERROR_INSUFFICIENT_SPACE;
}

// pack the id, group and member data into 5 bytes:
// 76543210 76543210 76543210
// 76543210 76543210
Expand Down

0 comments on commit 3c73b09

Please sign in to comment.