From 2e7be81ea4655f4c421a720edddb60601c51a544 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 7 Jun 2017 16:05:46 +0000 Subject: [PATCH] add unit test for overflow panic --- src/network/encodable.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/encodable.rs b/src/network/encodable.rs index 689a09d2..7127cd95 100644 --- a/src/network/encodable.rs +++ b/src/network/encodable.rs @@ -496,6 +496,8 @@ mod tests { fn deserialize_vec_test() { assert_eq!(deserialize(&[3u8, 2, 3, 4]).ok(), Some(vec![2u8, 3, 4])); assert_eq!(deserialize(&[4u8, 2, 3, 4, 5, 6]).ok(), Some(vec![2u8, 3, 4, 5])); + // found by cargo fuzz + assert!(deserialize::>(&[0xff,0xff,0xff,0xff,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0x6b,0xa,0xa,0x3a]).is_err()); } #[test]