Fixed illegal access on libps (#9192)

This commit is contained in:
Giovanni 2018-01-14 17:55:05 +01:00 committed by radare
parent e416a79097
commit 9a63f43d01

View File

@ -107,7 +107,7 @@ bool libps_decode(ut32 data, ppcps_t* ps) {
for (l = 0; l < size; l++) {
if ((data & instruction->mask) == instruction->opcode) {
j = 0;
for (; instruction->operands[j] != 0 && j < 6; j++) {
for (;j < 6 && instruction->operands[j] != 0; j++) {
ppcps_field_t* field = &ps->operands[j];
ps_operand_t* ps_operand = &ps_operands_array[instruction->operands[j]];
@ -195,4 +195,4 @@ void libps_snprint(char* str, int size, ut64 addr, ppcps_t* instr) {
add += snprintf (str + add, bufsize - add, " cr%u", instr->operands[i].value);
}
}
}
}