mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-27 15:30:33 +00:00
Add crash case: "Invalid read of size 4" in printOperand(…)
This commit is contained in:
parent
156b45ec28
commit
d3a0143bab
14
suite/regress/invalid_read_in_print_operand.c
Normal file
14
suite/regress/invalid_read_in_print_operand.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <capstone.h>
|
||||
|
||||
#define BINARY "\x3b\x30\x62\x93\x5d\x61\x03\xe8"
|
||||
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
csh handle;
|
||||
if (cs_open(CS_ARCH_X86, CS_MODE_64, &handle)) {
|
||||
printf("cs_open(…) failed\n");
|
||||
return 1;
|
||||
}
|
||||
cs_insn *insn;
|
||||
cs_disasm(handle, (uint8_t *)BINARY, sizeof(BINARY) - 1, 0x1000, 0, &insn);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user