mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Don't crash on invalid input
This commit is contained in:
parent
fe8d847408
commit
09d3f7386b
1 changed files with 3 additions and 1 deletions
|
|
@ -1807,7 +1807,9 @@ static const NSUInteger MTMaxUnacknowledgedMessageCount = 64;
|
|||
NSData *messageKey = [is readData:16];
|
||||
|
||||
MTMessageEncryptionKey *encryptionKey = [MTMessageEncryptionKey messageEncryptionKeyV2ForAuthKey:effectiveAuthKey.authKey messageKey:messageKey toClient:true];
|
||||
|
||||
if (data.length <= 24) {
|
||||
return;
|
||||
}
|
||||
NSMutableData *encryptedMessageData = [is readMutableData:(data.length - 24)];
|
||||
while (encryptedMessageData.length % 16 != 0) {
|
||||
[encryptedMessageData setLength:encryptedMessageData.length - 1];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue