mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-01-19 04:33:01 +00:00
Fix comparison using narrow types in loop condition
* Spotted by GitHub CodeQL vulnerability scanner * Related to: CWE-190, CWE-197 and CWE-835.
This commit is contained in:
parent
11a2ea2863
commit
1883e9e7ec
@ -9,7 +9,7 @@ static unsigned short *make_id2insn(const insn_map *insns, unsigned int size)
|
||||
{
|
||||
// NOTE: assume that the max id is always put at the end of insns array
|
||||
unsigned short max_id = insns[size - 1].id;
|
||||
unsigned short i;
|
||||
unsigned int i;
|
||||
|
||||
unsigned short *cache =
|
||||
(unsigned short *)cs_mem_calloc(max_id + 1, sizeof(*cache));
|
||||
|
Loading…
x
Reference in New Issue
Block a user