Fix range check in src/idlist.c

personal/stbuehler/wip
Stefan Bühler 13 years ago
parent 4128f3f128
commit 4be8052cf6
  1. 2
      src/idlist.c

@ -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…
Cancel
Save