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()
This commit is contained in:
Matt Corallo 2018-09-12 13:21:13 -04:00
parent c3e225597d
commit d7ed4c63e7

View file

@ -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}; 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<W> { writer: W } pub struct Writer<W> { writer: W }
pub struct Reader<R> { reader: R } pub struct Reader<R> { reader: R }