From d7ed4c63e7ac0ef94189e318300edc456d472e86 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 12 Sep 2018 13:21:13 -0400 Subject: [PATCH] Correct MAX_BUF_SIZE in serialization I think this might have been my fault due to faulty review feedback, but fuzzer caught trivial crash here where you try to send a ping message larger than 16KB (but smaller than the max-length 64KB) and you crash as message serialization is unwrap() --- src/util/ser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/ser.rs b/src/util/ser.rs index 1944519d0..299515d90 100644 --- a/src/util/ser.rs +++ b/src/util/ser.rs @@ -13,7 +13,7 @@ use ln::msgs::DecodeError; use util::byte_utils::{be64_to_array, be32_to_array, be16_to_array, slice_to_be16, slice_to_be32, slice_to_be64}; -const MAX_BUF_SIZE: usize = 16 * 1024; +const MAX_BUF_SIZE: usize = 64 * 1024; pub struct Writer { writer: W } pub struct Reader { reader: R } -- 2.39.5