decompression fix for OOM

This commit is contained in:
John Smith
2023-08-19 18:13:30 -04:00
parent 623e6621f3
commit eae839e484
5 changed files with 10 additions and 5 deletions

View File

@@ -214,8 +214,7 @@ impl Envelope {
);
// Decompress body
let body = decompress_size_prepended(&body)
.map_err(|e| VeilidAPIError::parse_error("failed to decompress", e))?;
let body = decompress_size_prepended(&body, Some(MAX_ENVELOPE_SIZE))?;
Ok(body)
}