diff --git a/librz/arch/p_gnu/analysis/analysis_cris_gnu.c b/librz/arch/p_gnu/analysis/analysis_cris_gnu.c index 874121dba4d..e8f8183afe6 100644 --- a/librz/arch/p_gnu/analysis/analysis_cris_gnu.c +++ b/librz/arch/p_gnu/analysis/analysis_cris_gnu.c @@ -4,10 +4,15 @@ #include #include +#define CRIS_MIN_OP_SIZE 2 + static int analyze_op(RzAnalysis *a, RzAnalysisOp *op, ut64 addr, const ut8 *buf, int len, RzAnalysisOpMask mask) { int opsize = -1; op->type = -1; - opsize = 2; + opsize = CRIS_MIN_OP_SIZE; + if (len < CRIS_MIN_OP_SIZE) { + return -1; + } switch (buf[0]) { case 0x3f: case 0x4f: