aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-07 19:33:48 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-07 19:33:48 +0100
commit158f7ee8919929b4daefb484d1a232d367d0c8e5 (patch)
treefef272b93ba190aa8400076b087c5b9642bcd43c /src
parenta4b2927884ded37556ea5009e10fffe12d8a6706 (diff)
Fix crash where the message length was shorter than the length of the mac
Diffstat (limited to 'src')
-rw-r--r--src/message.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/message.cpp b/src/message.cpp
index ffb9f6c..f98dfe5 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -213,6 +213,7 @@ void olm::decode_message(
reader.ciphertext_length = 0;
if (pos == end) return;
+ if (input_length < mac_length) return;
reader.version = *(pos++);
while (pos != end) {