From 0dce6d04ce3639ac557c81a5a713a7a8e35c16e9 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 24 Apr 2011 03:23:25 +0000 Subject: [PATCH] Fixed a potential invalid array access --- src/arch/dalvik.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arch/dalvik.c b/src/arch/dalvik.c index f4e2a91..7b7461d 100644 --- a/src/arch/dalvik.c +++ b/src/arch/dalvik.c @@ -183,7 +183,8 @@ static int _dalvik_decode(ArchPlugin * plugin, ArchInstructionCall * call) call->operands[0].type = ai->op1; call->operands[1].type = ai->op2; call->operands[2].type = ai->op3; - for(i = 0; AO_GET_TYPE(call->operands[i].type) != AOT_NONE; i++) + for(i = 0; i < 3 && AO_GET_TYPE(call->operands[i].type) != AOT_NONE; + i++) if(_decode_operand(&dd, i) != 0) return -1; call->operands_cnt = i;