From 224e24b283b8be99415431856e6b63dea7305996 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Mon, 19 Apr 2021 15:39:33 -0400 Subject: Fix Mach-O duplicate symbol handling for external relocations. --- python/binaryview.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 1fde4bcd..2af37321 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3956,7 +3956,10 @@ class BinaryView(object): elif sym_type is not None: raise AttributeError("Provided sym_type is not of type `binaryninja.Type`") - core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, sym_type) + sym = core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, sym_type) + if sym is None: + return None + return types.Symbol(None, None, None, handle = sym) def undefine_auto_symbol(self, sym): """ -- cgit v1.3.1