Fix IPV6 address deserialization (#1932)
Fuzz test found that we don't read IPV6 addr (as part of p2p message) properly. The code is supposed to read 8 dwords, but [0..8] is not a slice of 8 ints, but a slice of one Range, so we always read just one dword
This commit is contained in:
committed by
Ignotus Peverell
parent
109a426990
commit
0af1f13bf9
+9
-1
@@ -29,7 +29,15 @@ macro_rules! map_vec {
|
||||
#[macro_export]
|
||||
macro_rules! try_map_vec {
|
||||
($thing:expr, $mapfn:expr) => {
|
||||
$thing.iter().map($mapfn).collect::<Result<Vec<_>, _>>()?;
|
||||
try_iter_map_vec!($thing.iter(), $mapfn);
|
||||
};
|
||||
}
|
||||
|
||||
/// Same as try_map_vec when thing is an iterator
|
||||
#[macro_export]
|
||||
macro_rules! try_iter_map_vec {
|
||||
($thing:expr, $mapfn:expr) => {
|
||||
$thing.map($mapfn).collect::<Result<Vec<_>, _>>()?;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user