From b619396309c912ce3ce817b9775982200f4e38a7 Mon Sep 17 00:00:00 2001 From: Thomas Holder Date: Thu, 17 Oct 2019 08:53:44 +0200 Subject: fix heap-use-after-free Verb::set_tip takes a borrowed string pointer. This line in Effect::check() is invalid if getErrorReason() returns a temporary: _verb.set_tip(Extension::getErrorReason().c_str()); --- src/extension/extension.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension') diff --git a/src/extension/extension.h b/src/extension/extension.h index 4a857947e..2ddd8f3f4 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -143,7 +143,7 @@ public: void deactivate (); bool deactivated (); void printFailure (Glib::ustring reason); - std::string getErrorReason() { return _error_reason; }; + std::string const &getErrorReason() { return _error_reason; }; Implementation::Implementation * get_imp () { return imp; }; void set_execution_env (ExecutionEnv * env) { execution_env = env; }; ExecutionEnv *get_execution_env () { return execution_env; }; -- cgit v1.2.3