2
0
Fork 0

Fix range check in src/idlist.c

personal/stbuehler/wip
Stefan Bühler 2009-07-07 22:26:36 +02:00
parent 4128f3f128
commit 4be8052cf6
1 changed files with 1 additions and 1 deletions

View File

@ -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)));
}