From 09a1a0645f4a8ab19f11ec0594e740b7404eff85 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Sun, 6 Oct 2024 04:41:52 -0500 Subject: [PATCH] Memset MCInst to 0 on initialization. Old modules (and possibly the new ones as well) are not built for none zeroed MCInst. It leads again and again to segfaults or false disassembly. So now it is fixed. --- MCInst.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MCInst.c b/MCInst.c index 9c05f6f39b..9c5d7bac43 100644 --- a/MCInst.c +++ b/MCInst.c @@ -18,6 +18,7 @@ void MCInst_Init(MCInst *inst, cs_arch arch) { + memset(inst, 0, sizeof(MCInst)); // unnecessary to initialize in loop . its expensive and inst->size should be honored inst->Operands[0].Kind = kInvalid; inst->Operands[0].ImmVal = 0;