mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Skip over malformed data
This commit is contained in:
parent
f485065435
commit
65fa8eb914
@ -1495,7 +1495,9 @@ public final class PostboxDecoder {
|
||||
var objectLength: Int32 = 0
|
||||
memcpy(&objectLength, self.buffer.memory + self.offset, 4)
|
||||
if objectLength < 0 || objectLength > 2 * 1024 * 1024 {
|
||||
preconditionFailure()
|
||||
assertionFailure()
|
||||
self.offset = 0
|
||||
break
|
||||
}
|
||||
|
||||
let innerBuffer = ReadBuffer(memory: self.buffer.memory + (self.offset + 4), length: Int(objectLength), freeWhenDone: false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user