This is an automated email from the ASF dual-hosted git repository.

bennoe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 0fec9f4  Removed use-after-free bug in operation handling.
0fec9f4 is described below

commit 0fec9f439489dd0c31bf7be04225fb7631552b8a
Author: Benno Evers <[email protected]>
AuthorDate: Fri Mar 29 20:06:51 2019 +0100

    Removed use-after-free bug in operation handling.
    
    Switched the order of adjusting metrics and removing
    an operation to avoid a use-after-free bug in the master
    code.
    
    Review: https://reviews.apache.org/r/70342/
---
 src/master/master.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/master/master.cpp b/src/master/master.cpp
index 37f989a..aa19de1 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -11473,10 +11473,10 @@ void Master::__removeSlave(
     OPERATION_GONE_BY_OPERATOR;
 
   foreachvalue (Operation* operation, utils::copy(slave->operations)) {
-    removeOperation(operation);
     metrics->incrementOperationState(
         operation->info().type(),
         transitionState);
+    removeOperation(operation);
   }
 
   foreachvalue (
@@ -11485,10 +11485,10 @@ void Master::__removeSlave(
     foreachvalue (
         Operation* operation,
         utils::copy(provider.operations)) {
-      removeOperation(operation);
       metrics->incrementOperationState(
           operation->info().type(),
           transitionState);
+      removeOperation(operation);
     }
   }
 

Reply via email to