From a42082b652843e554747c7d39f20d66ba17f1337 Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Tue, 5 Nov 2024 20:30:59 +0100 Subject: [PATCH] Fix try_free command: make addr argument required (#2499) Fixes the following problem: ``` pwndbg> try_free TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' > /root/pwndbg/pwndbg/commands/heap.py(1195)try_free() 1194 def try_free(addr: str | int) -> None: -> 1195 addr = int(addr) 1196 ``` --- pwndbg/commands/heap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwndbg/commands/heap.py b/pwndbg/commands/heap.py index d93841939..c89f472e1 100644 --- a/pwndbg/commands/heap.py +++ b/pwndbg/commands/heap.py @@ -1186,7 +1186,7 @@ def bin_labels_mapping(collections): try_free_parser = argparse.ArgumentParser( description="Check what would happen if free was called with given address." ) -try_free_parser.add_argument("addr", nargs="?", help="Address passed to free") +try_free_parser.add_argument("addr", help="Address passed to free") @pwndbg.commands.ArgparsedCommand(try_free_parser, category=CommandCategory.HEAP)