Skip to content

Commit

Permalink
Fix incorrect memory read after free in exn handler
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov committed Oct 5, 2023
1 parent 7aee5cd commit 3270d3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/thirdparty/googletest
Submodule googletest updated 291 files
25 changes: 5 additions & 20 deletions trikKernel/include/trikKernel/exceptions/trikRuntimeException.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,17 @@
namespace trikKernel {

/// Base class for all exceptions in TRIKRuntime.
class TrikRuntimeException : public std::exception
class TrikRuntimeException : public std::runtime_error
{
public:
/// Constructor
/// @param msg - message to be returned
explicit TrikRuntimeException(const QString &msg):
mMessage(msg)
explicit TrikRuntimeException(const QString &msg)
: std::runtime_error(msg.toStdString())
{
/// Vera
QLOG_ERROR() << message();
/// Print before processing the exception
QLOG_ERROR() << what();
}

/// Destructor
~TrikRuntimeException() = default;

/// Returns the exception message
const char *what() const noexcept override
{
/// Vera
return message().toLatin1().constData();
}

/// Returns the exception message
const QString &message() const { return mMessage; }
private:
QString mMessage;
};

}

0 comments on commit 3270d3a

Please sign in to comment.