mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-27 23:40:25 +00:00
fix off-by-one error in make_id2insn. patch by Dang Hoang Vu
This commit is contained in:
parent
1acfd0b883
commit
0b93e19460
2
utils.c
2
utils.c
@ -28,7 +28,7 @@ static unsigned short *make_id2insn(insn_map *insns, unsigned int size)
|
||||
unsigned short max_id = insns[size - 1].id;
|
||||
unsigned int i;
|
||||
|
||||
unsigned short *cache = (unsigned short *)my_calloc(sizeof(*cache), max_id);
|
||||
unsigned short *cache = (unsigned short *)my_calloc(sizeof(*cache), max_id + 1);
|
||||
|
||||
for (i = 1; i < size; i++)
|
||||
cache[insns[i].id] = i;
|
||||
|
Loading…
Reference in New Issue
Block a user