Skip to content

Commit

Permalink
fix(base-node/grpc): fixes panic if invalid kernel mr is given (#4693)
Browse files Browse the repository at this point in the history
Description
---
Fixes panic if invalid kernel mr is given via grpc

Motivation and Context
---
Panic can be triggered by user-controller input 

How Has This Been Tested?
---
Not tested
  • Loading branch information
sdbondi authored Sep 20, 2022
1 parent cd183ef commit 80af7fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion applications/tari_app_grpc/src/conversions/block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl TryFrom<grpc::BlockHeader> for BlockHeader {
output_mr: FixedHash::try_from(header.output_mr).map_err(|err| err.to_string())?,
witness_mr: FixedHash::try_from(header.witness_mr).map_err(|err| err.to_string())?,
output_mmr_size: header.output_mmr_size,
kernel_mr: FixedHash::try_from(header.kernel_mr).expect("Array size 32 cannot fail"),
kernel_mr: FixedHash::try_from(header.kernel_mr).map_err(|err| err.to_string())?,
kernel_mmr_size: header.kernel_mmr_size,
total_kernel_offset,
total_script_offset,
Expand Down

0 comments on commit 80af7fa

Please sign in to comment.