Skip to content

Commit

Permalink
Fix CVE-2022-1207: out of bound read in GNU cris analysis plugin (#4629)
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio authored Sep 11, 2024
1 parent 6f0d675 commit d167921
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion librz/arch/p_gnu/analysis/analysis_cris_gnu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
#include <rz_asm.h>
#include <rz_lib.h>

#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:
Expand Down

0 comments on commit d167921

Please sign in to comment.