From 71a4ab4a6f737a24b6ef453978f9af2d8008c8b4 Mon Sep 17 00:00:00 2001 From: Catena cyber <35799796+catenacyber@users.noreply.github.com> Date: Tue, 26 May 2020 14:52:40 +0200 Subject: [PATCH] Removes some bugs found by oss-fuzz (#1266) Leak on breakpoints Undefined shift in ARM --- qemu/target-arm/neon_helper.c | 2 +- qemu/unicorn_common.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/target-arm/neon_helper.c b/qemu/target-arm/neon_helper.c index 345e8bc7..fdae9d45 100644 --- a/qemu/target-arm/neon_helper.c +++ b/qemu/target-arm/neon_helper.c @@ -666,7 +666,7 @@ NEON_VOP(shl_s32, neon_s32, 1) uint64_t HELPER(neon_shl_s64)(uint64_t valop, uint64_t shiftop) { int8_t shift = (int8_t)shiftop; - int64_t val = valop; + uint64_t val = valop; if (shift >= 64) { val = 0; } else if (shift <= -64) { diff --git a/qemu/unicorn_common.h b/qemu/unicorn_common.h index 0aa1e5c3..2117c621 100644 --- a/qemu/unicorn_common.h +++ b/qemu/unicorn_common.h @@ -52,6 +52,7 @@ static void release_common(void *t) tb_cleanup(s->uc); free_code_gen_buffer(s->uc); cpu_watchpoint_remove_all(CPU(s->uc->cpu), BP_CPU); + cpu_breakpoint_remove_all(CPU(s->uc->cpu), BP_CPU); #if TCG_TARGET_REG_BITS == 32 for(i = 0; i < s->nb_globals; i++) {