From 46c544a5cae7d70ca627f1eb02c00edf76fc2c6e Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Thu, 5 Nov 2020 05:21:01 +0300 Subject: [PATCH] deltachat-ffi: forbid quoting messages from another context --- deltachat-ffi/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 36aab586a..8e95669a8 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -3008,6 +3008,11 @@ pub unsafe extern "C" fn dc_msg_set_quote(msg: *mut dc_msg_t, quote: *const dc_m let ffi_msg = &mut *msg; let ffi_quote = &*quote; + if ffi_msg.context != ffi_quote.context { + eprintln!("ignoring attempt to quote message from a different context"); + return; + } + block_on(async move { ffi_msg .message