Fix bug in early-HTLC-fulfill handling
[rust-lightning] / fuzz / fuzz_targets / msg_targets / msg_update_fail_malformed_htlc_target.rs
index 4ea37a5b1d9302689a9c56c6b12fa03fe445171d..9c90992593ebe4a1fb3162dd9e3e0a78180d6c11 100644 (file)
@@ -9,15 +9,11 @@ use lightning::util::reset_rng_state;
 use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
 
 mod utils;
-use utils::slice_to_be16;
 
 #[inline]
 pub fn do_test(data: &[u8]) {
        reset_rng_state();
-       let mut read_pos = 0;
-       loop {
-               test_msg!(msgs::UpdateFailMalformedHTLC, data, read_pos);
-       }
+       test_msg!(msgs::UpdateFailMalformedHTLC, data);
 }
 
 #[cfg(feature = "afl")]
@@ -40,13 +36,11 @@ fn main() {
        }
 }
 
+extern crate hex;
 #[cfg(test)]
 mod tests {
-       use utils::extend_vec_from_hex;
        #[test]
        fn duplicate_crash() {
-               let mut a = Vec::new();
-               extend_vec_from_hex("00", &mut a);
-               super::do_test(&a);
+               super::do_test(&::hex::decode("00").unwrap());
        }
 }