Add check for empty string before passing it to os.path.relpath (#3372)

pull/3364/head
OBarronCS 2 months ago committed by GitHub
parent 3218591627
commit f13cd4654b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save