You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-30 02:21:17 +03:00
Megolm import: Fix handling of short files
Make sure we throw a sensible error when the body of the data is too short.
This commit is contained in:
@ -50,7 +50,7 @@ export function decryptMegolmKeyFile(data, password) {
|
||||
}
|
||||
|
||||
const ciphertextLength = body.length-(1+16+16+4+32);
|
||||
if (body.length < 0) {
|
||||
if (ciphertextLength < 0) {
|
||||
throw new Error('Invalid file: too short');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user