Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ValekoZ committed Sep 23, 2024
1 parent 9664987 commit 376a07a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/api/gef_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,17 @@ def test_func_parse_maps_realpath(self):
"/usr" not in section.realpath):
assert pathlib.Path(section.realpath).is_file()
break

def test_func_read_cstring_oob(self):
gef, gdb = self._gef, self._gdb

gdb.execute("b main")
gdb.execute("start")

section = gef.memory.maps[0]
oob_val = gef.memory.read_cstring(section.page_start, section.page_end -
section.page_start + 0x100)
val = gef.memory.read_cstring(section.page_start, section.page_end -
section.page_start)

assert val == oob_val

0 comments on commit 376a07a

Please sign in to comment.