Fix crash when mapping a big memory and calling uc_close

This commit is contained in:
2022-04-16 19:17:41 +02:00
parent cf18982e1c
commit 3d3deac5e6
5 changed files with 353 additions and 8 deletions

View File

@@ -175,6 +175,18 @@ static void test_map_wrap(void)
OK(uc_close(uc));
}
static void test_map_big_memory(void)
{
uc_engine *uc;
OK(uc_open(UC_ARCH_X86, UC_MODE_64, &uc));
uc_assert_err(UC_ERR_NOMEM,
uc_mem_map(uc, 0x0, 0xfffffffffffff000, UC_PROT_ALL));
OK(uc_close(uc));
}
TEST_LIST = {{"test_map_correct", test_map_correct},
{"test_map_wrapping", test_map_wrapping},
{"test_mem_protect", test_mem_protect},
@@ -183,4 +195,5 @@ TEST_LIST = {{"test_map_correct", test_map_correct},
{"test_mem_protect_map_ptr", test_mem_protect_map_ptr},
{"test_map_at_the_end", test_map_at_the_end},
{"test_map_wrap", test_map_wrap},
{"test_map_big_memory", test_map_big_memory},
{NULL, NULL}};