Skip to content

Commit 7f89095

Browse files
committed
Fix unchecked addition.
1 parent dc0c4c0 commit 7f89095

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ pub(super) fn construct_trampoline_onion_packet(
425425
.map(|p| {
426426
let mut payload_len = LengthCalculatingWriter(0);
427427
p.write(&mut payload_len).expect("Failed to calculate length");
428-
payload_len.0 + 32
428+
payload_len.0.checked_add(32).expect("Excessive payload size")
429429
})
430430
.sum();
431431

0 commit comments

Comments
 (0)