mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Fix fuzzer-found underflow
This commit is contained in:
parent
b414c0641b
commit
81b7b03d4f
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ impl LengthReadable for Packet {
|
|||
let public_key = Readable::read(r)?;
|
||||
|
||||
let mut hop_data = Vec::new();
|
||||
let hop_data_len = r.total_bytes() as usize - 66; // 1 (version) + 33 (pubkey) + 32 (HMAC) = 66
|
||||
let hop_data_len = r.total_bytes().saturating_sub(66) as usize; // 1 (version) + 33 (pubkey) + 32 (HMAC) = 66
|
||||
let mut read_idx = 0;
|
||||
while read_idx < hop_data_len {
|
||||
let mut read_buffer = [0; READ_BUFFER_SIZE];
|
||||
|
|
Loading…
Add table
Reference in a new issue