Skip to content

Commit

Permalink
dereference_from Use GEF_MAX_STRING_LENGTH (#1075)
Browse files Browse the repository at this point in the history
We hardcode string deref length to 50, but we don't use this constant in
`dereference_from`.

See #1074
  • Loading branch information
Grazfather committed Mar 9, 2024
1 parent cdaf158 commit 820d81f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -8508,8 +8508,8 @@ def dereference_from(address: int) -> List[str]:
s = gef.memory.read_cstring(addr.value)
if len(s) < gef.arch.ptrsize:
txt = f'{format_address(deref)} ("{Color.colorify(s, string_color)}"?)'
elif len(s) > 50:
txt = Color.colorify(f'"{s[:50]}[...]"', string_color)
elif len(s) > GEF_MAX_STRING_LENGTH:
txt = Color.colorify(f'"{s[:GEF_MAX_STRING_LENGTH]}[...]"', string_color)
else:
txt = Color.colorify(f'"{s}"', string_color)

Expand Down

0 comments on commit 820d81f

Please sign in to comment.