mirror of
https://github.com/serai-dex/serai.git
synced 2024-11-17 09:27:36 +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:
parent
8af3a9ea51
commit
d12507e612
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ pub fn read_raw_vec<R: io::Read, T, F: Fn(&mut R) -> io::Result<T>>(
|
|||
len: usize,
|
||||
r: &mut R,
|
||||
) -> io::Result<Vec<T>> {
|
||||
let mut res = Vec::with_capacity(len);
|
||||
let mut res = vec![];
|
||||
for _ in 0 .. len {
|
||||
res.push(f(r)?);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue