Loading
RootCanal: Fix potential use-after-free issues
The tasks registered within LinkLayerController capture the pointer to the Controller instance for member access. These tasks can outlive the Controller instance if the controller is deleted (e.g. through the test channel, or because the TCP connection is lost). In this case attempting to execute the task callback would cause a use-after-free invalid pointer access. This change bypasses the issue by capturing a weak pointer to the instance to check if it is live before running the task callback. Test: m root-canal && launch_cvd Change-Id: I5384fc056fc4fbc0095b99ef7113fd4f706803ba