diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2023-01-24 18:38:13 -0700 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2023-01-30 11:57:43 -0500 |
| commit | a3939bdec15f9299ae9a681255fa93c47113870a (patch) | |
| tree | 2b4bb5643ac3cd25a618a99a542968fe81c66bcc /architecture.cpp | |
| parent | cf4220570c2d1b7105fb29719383f64026d46837 (diff) | |
Fix UAF on C++ BinaryView plugin init, improve demangler and BinaryView APIs
Diffstat (limited to 'architecture.cpp')
| -rw-r--r-- | architecture.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/architecture.cpp b/architecture.cpp index 7fcc43a8..3c44202f 100644 --- a/architecture.cpp +++ b/architecture.cpp @@ -1252,7 +1252,10 @@ void Architecture::RegisterRelocationHandler(const string& viewName, RelocationH Ref<RelocationHandler> Architecture::GetRelocationHandler(const std::string& viewName) { - return new CoreRelocationHandler(BNArchitectureGetRelocationHandler(m_object, viewName.c_str())); + auto handler = BNArchitectureGetRelocationHandler(m_object, viewName.c_str()); + if (!handler) + return nullptr; + return new CoreRelocationHandler(handler); } bool Architecture::IsBinaryViewTypeConstantDefined(const string& type, const string& name) |
