Generate an extra block to trigger segfault

This commit is contained in:
lazymio 2022-06-02 14:45:38 +02:00
parent 40436e885b
commit 637dc8a8a0
No known key found for this signature in database
GPG Key ID: DFF27E34A47CB873
1 changed files with 3 additions and 2 deletions

View File

@ -237,7 +237,8 @@ static void test_uc_hook_cached_cb(uc_engine* uc, uint64_t addr, size_t size, vo
static void test_uc_hook_cached_uaf(void)
{
uc_engine* uc;
char code[] = "\x41\x4a";
// "INC ecx; DEC edx; jmp t; t: nop"
char code[] = "\x41\x4a\xeb\x00\x90";
uc_hook h;
uint64_t count = 0;
#ifndef _WIN32
@ -265,7 +266,7 @@ static void test_uc_hook_cached_uaf(void)
// Now hooks are deleted and thus this will trigger a UAF
OK(uc_emu_start(uc, code_start, code_start + sizeof(code) - 1, 0, 0));
TEST_CHECK(count == 2);
TEST_CHECK(count == 4);
OK(uc_close(uc));