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 /type.cpp | |
| parent | cf4220570c2d1b7105fb29719383f64026d46837 (diff) | |
Fix UAF on C++ BinaryView plugin init, improve demangler and BinaryView APIs
Diffstat (limited to 'type.cpp')
| -rw-r--r-- | type.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -794,7 +794,8 @@ Ref<Type> Type::EnumerationType(Architecture* arch, Enumeration* enm, size_t wid BNBoolWithConfidence isSignedConf; isSignedConf.value = isSigned.GetValue(); isSignedConf.confidence = isSigned.GetConfidence(); - return new Type(BNCreateEnumerationType(arch->GetObject(), enm->GetObject(), width, &isSignedConf)); + return new Type( + BNCreateEnumerationType(arch ? arch->GetObject() : nullptr, enm->GetObject(), width, &isSignedConf)); } @@ -1629,8 +1630,8 @@ TypeBuilder TypeBuilder::EnumerationType( BNBoolWithConfidence isSignedConf; isSignedConf.value = isSigned.GetValue(); isSignedConf.confidence = isSigned.GetConfidence(); - return TypeBuilder( - BNCreateEnumerationTypeBuilderWithBuilder(arch->GetObject(), enm->GetObject(), width, &isSignedConf)); + return TypeBuilder(BNCreateEnumerationTypeBuilderWithBuilder( + arch ? arch->GetObject() : nullptr, enm->GetObject(), width, &isSignedConf)); } TypeBuilder TypeBuilder::PointerType(Architecture* arch, const Confidence<Ref<Type>>& type, |
