Skip to content

Commit

Permalink
core: mem/f_malloc - explicit set to 0 for bit shifting greater than …
Browse files Browse the repository at this point in the history
…size

(cherry picked from commit 0cb33ab)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent d887e6a commit e37fbf0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/mem/f_malloc.c
Expand Up @@ -122,7 +122,8 @@ inline static int fm_bmp_first_set(struct fm_block* qm, int start)
return (start-bit+r);
}
#endif
v=qm->free_bitmap[bmp_idx]>>(bit+1);
if((bit+1) < 8*sizeof(v)) v=qm->free_bitmap[bmp_idx]>>(bit+1);
else v = 0;
return start+1+bit_scan_forward((unsigned long)v);
}
for (r=bmp_idx+1;r<FM_HASH_BMP_SIZE; r++){
Expand Down

0 comments on commit e37fbf0

Please sign in to comment.