mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 07:00:30 +00:00
Fix undefined behaviour issue in capstone-x86
This commit is contained in:
parent
e5cfb20adb
commit
d692bfb37a
20
shlr/capstone-patches/fix-ub.patch
Normal file
20
shlr/capstone-patches/fix-ub.patch
Normal file
@ -0,0 +1,20 @@
|
||||
--- a/arch/X86/X86Disassembler.c.orig 2017-04-20 16:42:06.000000000 +0200
|
||||
+++ b/arch/X86/X86Disassembler.c 2017-04-20 16:42:51.000000000 +0200
|
||||
@@ -901,7 +901,7 @@
|
||||
MCInst *instr, uint16_t *size, uint64_t address, void *_info)
|
||||
{
|
||||
cs_struct *handle = (cs_struct *)(uintptr_t)ud;
|
||||
- InternalInstruction insn;
|
||||
+ InternalInstruction insn = {0};
|
||||
struct reader_info info;
|
||||
int ret;
|
||||
bool result;
|
||||
@@ -910,8 +910,6 @@
|
||||
info.size = code_len;
|
||||
info.offset = address;
|
||||
|
||||
- memset(&insn, 0, offsetof(InternalInstruction, reader));
|
||||
-
|
||||
if (instr->flat_insn->detail) {
|
||||
instr->flat_insn->detail->x86.op_count = 0;
|
||||
instr->flat_insn->detail->x86.sse_cc = X86_SSE_CC_INVALID;
|
Loading…
Reference in New Issue
Block a user