From 4489f710d8b882087b122280445500ba73b941ca Mon Sep 17 00:00:00 2001 From: Nadja Reitzenstein Date: Fri, 11 Mar 2022 22:43:34 +0100 Subject: [PATCH] Fix a segfault caused by moving into an uninitalized pointer --- runtime/executor/src/pool.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/executor/src/pool.rs b/runtime/executor/src/pool.rs index cc6015f..88893a1 100644 --- a/runtime/executor/src/pool.rs +++ b/runtime/executor/src/pool.rs @@ -145,10 +145,9 @@ impl<'a, 'executor: 'a> Executor<'executor> { // Wrap the future into one that stores the result into `out`. let future = { - let out = out.as_mut_ptr(); - + let out: *mut R = out.as_mut_ptr(); async move { - *out = future.await; + out.write(future.await); } };