From: Matt Corallo Date: Wed, 12 Sep 2018 17:21:13 +0000 (-0400) Subject: Correct MAX_BUF_SIZE in serialization X-Git-Tag: v0.0.12~315^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=d7ed4c63e7ac0ef94189e318300edc456d472e86;p=rust-lightning 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() --- 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 }