Don't ignore set safe-linking settings (#2484)

* Don't ignore set safe-linking settings

The previous code was testing the existance of the safe_lnk option
object, which always exists, and therefore was ignoring the actual
value of the option. Change the test to safe_lnk.value.

* Update pwndbg/glibc.py

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
pull/2488/head
Giuseppe Lettieri 1 year ago committed by GitHub
parent 3226ade3ff
commit f35e22441a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -197,4 +197,4 @@ def check_safe_linking() -> bool:
- https://lanph3re.blogspot.com/2020/08/blog-post.html
- https://research.checkpoint.com/2020/safe-linking-eliminating-a-20-year-old-malloc-exploit-primitive/
"""
return (get_version() >= (2, 32) or safe_lnk) and safe_lnk is not False # type: ignore[return-value]
return (get_version() >= (2, 32) or safe_lnk.value) and safe_lnk.value is not False

Loading…
Cancel
Save