mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 06:46:32 +03:00
Fix potential use-after-free in dc_jsonrpc_request()
This commit is contained in:
@@ -4653,8 +4653,12 @@ mod jsonrpc {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let api = &*jsonrpc_instance;
|
let handle = &(*jsonrpc_instance).handle;
|
||||||
let handle = &api.handle;
|
|
||||||
|
// Clone the handle so we do not use the reference
|
||||||
|
// in spawned task after return from dc_jsonrpc_request().
|
||||||
|
let handle = handle.clone();
|
||||||
|
|
||||||
let request = to_string_lossy(request);
|
let request = to_string_lossy(request);
|
||||||
spawn(async move {
|
spawn(async move {
|
||||||
handle.handle_incoming(&request).await;
|
handle.handle_incoming(&request).await;
|
||||||
|
|||||||
Reference in New Issue
Block a user