mirror of
https://gitlab.com/qemu-project/capstone.git
synced 2025-06-29 04:31:51 +08:00
Corrected a bug
Corrected a bug that would cause capstone to crash under certain invalid instructions.
This commit is contained in:
@ -68,12 +68,17 @@ void TMS320C64x_post_printer(csh ud, cs_insn *insn, char *insn_asm, MCInst *mci)
|
|||||||
|
|
||||||
SStream_concat0(&ss, insn_asm);
|
SStream_concat0(&ss, insn_asm);
|
||||||
if((p != NULL) && (((p2 = strchr(p, '[')) != NULL) || ((p2 = strchr(p, '(')) != NULL))) {
|
if((p != NULL) && (((p2 = strchr(p, '[')) != NULL) || ((p2 = strchr(p, '(')) != NULL))) {
|
||||||
while((*p2 != 'A') && (*p2 != 'B'))
|
while((p2 > p) && ((*p2 != 'A') && (*p2 != 'B')))
|
||||||
p2--;
|
p2--;
|
||||||
if(*p2 == 'A')
|
if(p2 == p) {
|
||||||
strcpy(tmp, "1T");
|
strcpy(insn_asm, "Invalid!");
|
||||||
else
|
return;
|
||||||
strcpy(tmp, "2T");
|
} else {
|
||||||
|
if(*p2 == 'A')
|
||||||
|
strcpy(tmp, "1T");
|
||||||
|
else
|
||||||
|
strcpy(tmp, "2T");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user