From ac3bf5b71d80d0dbdbacfbac1fc9528d09391237 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 20 Mar 2018 16:41:33 -0400 Subject: [PATCH] Fix length requirement in peer_handler msg decode --- src/ln/peer_handler.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ln/peer_handler.rs b/src/ln/peer_handler.rs index 74848ad77..3a0d6b66d 100644 --- a/src/ln/peer_handler.rs +++ b/src/ln/peer_handler.rs @@ -299,7 +299,7 @@ impl PeerManager { let msg_len = try_potential_handleerror!(peer.channel_encryptor.decrypt_length_header(&peer.pending_read_buffer[..])); peer.pending_read_buffer = Vec::with_capacity(msg_len as usize + 16); peer.pending_read_buffer.resize(msg_len as usize + 16, 0); - if msg_len < 2 + 16 { // Need at least the message type tag + if msg_len < 2 { // Need at least the message type tag return Err(PeerHandleError{}); } peer.pending_read_is_header = false; -- 2.39.5