summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-10-04 21:46:31 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-10-04 21:46:31 +0200
commit4dd5f9841dcc9d3e43f8376b748ab1fa115c54a6 (patch)
treebcd3e31543162bd4f155aa7450cd4972f8dc9cd4
parentMerge pull request #744 from LorenDB/reorganizeQml (diff)
downloadnheko-4dd5f9841dcc9d3e43f8376b748ab1fa115c54a6.tar.xz
Add additional check for invalid megolm sessions
-rw-r--r--CMakeLists.txt2
-rw-r--r--io.github.NhekoReborn.Nheko.yaml2
-rw-r--r--src/Olm.cpp4
3 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt

index 85726fed..a3b344b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -385,7 +385,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG b452a984b0fc522c21bb8df7d320bf13960974d0 + GIT_TAG 4a598632f432953f4dbfacf6cfed4f85a1c59c5a ) set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "") set(BUILD_LIB_TESTS OFF CACHE INTERNAL "") diff --git a/io.github.NhekoReborn.Nheko.yaml b/io.github.NhekoReborn.Nheko.yaml
index 4b0f7bf3..e4b6ed8f 100644 --- a/io.github.NhekoReborn.Nheko.yaml +++ b/io.github.NhekoReborn.Nheko.yaml
@@ -163,7 +163,7 @@ modules: buildsystem: cmake-ninja name: mtxclient sources: - - commit: b452a984b0fc522c21bb8df7d320bf13960974d0 + - commit: 4a598632f432953f4dbfacf6cfed4f85a1c59c5a type: git url: https://github.com/Nheko-Reborn/mtxclient.git - config-opts: diff --git a/src/Olm.cpp b/src/Olm.cpp
index 60460b5c..14c97984 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp
@@ -1129,6 +1129,10 @@ decryptEvent(const MegolmSessionIndex &index, std::string msg_str; try { auto session = cache::client()->getInboundMegolmSession(index); + if (!session) { + return {DecryptionErrorCode::MissingSession, std::nullopt, std::nullopt}; + } + auto sessionData = cache::client()->getMegolmSessionData(index).value_or(GroupSessionData{});