From f13cd4654b0cdd982687e9856ac4c1cf180f7b7b Mon Sep 17 00:00:00 2001 From: OBarronCS <55004530+OBarronCS@users.noreply.github.com> Date: Sat, 25 Oct 2025 05:23:59 -0400 Subject: [PATCH] Add check for empty string before passing it to os.path.relpath (#3372) --- pwndbg/lib/memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwndbg/lib/memory.py b/pwndbg/lib/memory.py index 7b986c5da..c3d680091 100644 --- a/pwndbg/lib/memory.py +++ b/pwndbg/lib/memory.py @@ -160,7 +160,7 @@ class Page: ) def __str__(self) -> str: - if pwndbg.config.vmmap_prefer_relpaths: + if pwndbg.config.vmmap_prefer_relpaths and self.objfile: rel = relpath(self.objfile) # Keep the origin path when relative paths are longer than absolute ones. objfile = self.objfile if len(rel) > len(self.objfile) else rel