mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Fix a DoS in Monero
A malicious TX could cause an arbitrary amount of memory to be allocated despite not even containing that amount of data.
This commit is contained in:
@@ -100,7 +100,7 @@ pub fn read_raw_vec<R: io::Read, T, F: Fn(&mut R) -> io::Result<T>>(
|
|||||||
len: usize,
|
len: usize,
|
||||||
r: &mut R,
|
r: &mut R,
|
||||||
) -> io::Result<Vec<T>> {
|
) -> io::Result<Vec<T>> {
|
||||||
let mut res = Vec::with_capacity(len);
|
let mut res = vec![];
|
||||||
for _ in 0 .. len {
|
for _ in 0 .. len {
|
||||||
res.push(f(r)?);
|
res.push(f(r)?);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user