From 8c00d6124607932ce8c02aeac5a20b0523f0a609 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 30 Sep 2021 17:04:47 -0400 Subject: Add some additional asserts around calls to BNCreatePlatform --- python/platform.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python') diff --git a/python/platform.py b/python/platform.py index 0d06e362..2328fb17 100644 --- a/python/platform.py +++ b/python/platform.py @@ -68,11 +68,13 @@ class Platform(metaclass=_PlatformMetaClass): _arch = arch if self.__class__.type_file_path is None: _handle = core.BNCreatePlatform(arch.handle, self.__class__.name) + assert _handle is not None else: dir_buf = (ctypes.c_char_p * len(self.__class__.type_include_dirs))() for (i, dir) in enumerate(self.__class__.type_include_dirs): dir_buf[i] = dir.encode('charmap') _handle = core.BNCreatePlatformWithTypes(arch.handle, self.__class__.name, self.__class__.type_file_path, dir_buf, len(self.__class__.type_include_dirs)) + assert _handle is not None else: _handle = handle _arch = architecture.CoreArchitecture._from_cache(core.BNGetPlatformArchitecture(_handle)) -- cgit v1.3.1