Skip to content

Fix channelmonitor fuzz test failure #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/ln/channelmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,14 @@ impl ChannelMonitor {
() => {
{
let tx_len = byte_utils::slice_to_be64(read_bytes!(8));
let tx: Transaction = unwrap_obj!(serialize::deserialize(read_bytes!(tx_len)));
let tx_ser = read_bytes!(tx_len);
let tx: Transaction = unwrap_obj!(serialize::deserialize(tx_ser));
if serialize::serialize(&tx).unwrap() != tx_ser {
// We check that the tx re-serializes to the same form to ensure there is
// no extra data, and as rust-bitcoin doesn't handle the 0-input ambiguity
// all that well.
return None;
}

let revocation_key = unwrap_obj!(PublicKey::from_slice(&secp_ctx, read_bytes!(33)));
let a_htlc_key = unwrap_obj!(PublicKey::from_slice(&secp_ctx, read_bytes!(33)));
Expand Down