summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-02-11 21:51:05 -0500
committerMason Reed <mason@vector35.com>2025-02-12 18:43:02 -0500
commit8dd4e14da7ddd182a7fd9ea9437b7135f0c5cd9e (patch)
treec60597e1bbb031d15d5e13c184c060060eff285f /view/sharedcache/core/SharedCache.cpp
parent95d84deb165c79772a0c0698e0a70d14aecd9de5 (diff)
[SharedCache] Always initialize logger first
Potential nullptr deref on invalid view type (see the error log right after the logger init)
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
-rw-r--r--view/sharedcache/core/SharedCache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp
index e4d5c5cf..2eae9d44 100644
--- a/view/sharedcache/core/SharedCache.cpp
+++ b/view/sharedcache/core/SharedCache.cpp
@@ -1363,6 +1363,7 @@ void SharedCache::ParseAndApplySlideInfoForFile(std::shared_ptr<MMappedFileAcces
SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) : m_dscView(dscView), m_viewSpecificState(ViewSpecificStateForView(dscView))
{
+ m_logger = LogRegistry::GetLogger("SharedCache", dscView->GetFile()->GetSessionId());
if (dscView->GetTypeName() != VIEW_NAME)
{
// Unreachable?
@@ -1371,7 +1372,6 @@ SharedCache::SharedCache(BinaryNinja::Ref<BinaryNinja::BinaryView> dscView) : m_
}
sharedCacheReferences++;
INIT_SHAREDCACHE_API_OBJECT()
- m_logger = LogRegistry::GetLogger("SharedCache", dscView->GetFile()->GetSessionId());
DeserializeFromRawView();
if (!m_metadataValid)
return;