Skip to content

Crash on use of out of scope binary view in Python #8161

@D0ntPanic

Description

@D0ntPanic

Version and Platform (required):

  • Binary Ninja Version: 5.4.9605
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 26.4.1
  • CPU Architecture: M5

Bug Description:
If you load a binary view with a with block, then access the variable holding the view outside the with block, the process crashes trying to read a null pointer in the FFI layer.

This is buggy Python code, but it shouldn't crash the process.

Steps To Reproduce:
Paste the following code in the Python console:

if True:
    with load("/bin/ls") as a:
        pass
    print(a)

The process should immediately crash with a null pointer access.

Expected Behavior:
Should get a Python exception instead of crashing the entire process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions