onGroupReceived: Only process a group if it has a 16-byte id

This commit is contained in:
Scott Nonnenberg 2020-07-01 11:53:15 -07:00
parent fd612234bb
commit 82bf517a69

View file

@ -2116,6 +2116,15 @@
const details = ev.groupDetails; const details = ev.groupDetails;
const { id } = details; const { id } = details;
const idBuffer = window.Signal.Crypto.fromEncodedBinaryToArrayBuffer(id);
const idBytes = idBuffer.byteLength;
if (idBytes !== 16) {
window.log.error(
`onGroupReceived: Id was ${idBytes} bytes, expected 16 bytes. Dropping group.`
);
return;
}
const conversation = await ConversationController.getOrCreateAndWait( const conversation = await ConversationController.getOrCreateAndWait(
id, id,
'group' 'group'