Fix range check in src/idlist.c
parent
4128f3f128
commit
4be8052cf6
|
@ -101,7 +101,7 @@ gboolean idlist_is_used(idlist *l, gint id) {
|
|||
GArray *a = l->bitvector;
|
||||
guint ndx = id / UL_BITS, bndx = id % UL_BITS;
|
||||
gulong bmask = 1 << bndx;
|
||||
if (id < 0 || ndx > a->len) return FALSE;
|
||||
if (id < 0 || ndx >= a->len) return FALSE;
|
||||
|
||||
return (0 != (g_array_index(a, gulong, ndx) & (bmask)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue