diff --git a/librz/arch/p/analysis/analysis_xtensa_cs.c b/librz/arch/p/analysis/analysis_xtensa_cs.c index d6537af6665..e174d0b166e 100644 --- a/librz/arch/p/analysis/analysis_xtensa_cs.c +++ b/librz/arch/p/analysis/analysis_xtensa_cs.c @@ -308,6 +308,11 @@ static void xop_to_rval(RzAnalysis *a, XtensaContext *ctx, cs_xtensa_op *xop, Rz static void xtensa_analyze_op(RzAnalysis *a, RzAnalysisOp *op, XtensaContext *ctx) { int src_count = 0; for (int i = 0; i < ctx->insn->detail->xtensa.op_count; ++i) { + if (src_count >= RZ_ARRAY_SIZE(op->src)) { + rz_warn_if_reached(); + break; + } + cs_xtensa_op *xop = XOP(i); if (xop->access & CS_AC_WRITE) { xop_to_rval(a, ctx, xop, &op->dst); diff --git a/librz/include/rz_analysis.h b/librz/include/rz_analysis.h index 5b1600f1372..9a47aba8b6b 100644 --- a/librz/include/rz_analysis.h +++ b/librz/include/rz_analysis.h @@ -928,7 +928,7 @@ typedef struct rz_analysis_op_t { st64 stackptr; /* stack pointer */ int refptr; /* if (0) ptr = "reference" else ptr = "load memory of refptr bytes" */ ut64 mmio_address; // mmio address - RzAnalysisValue *src[6]; + RzAnalysisValue *src[8]; RzAnalysisValue *dst; RzList /**/ *access; /* RzAnalysisValue access information */ RzStrBuf esil;