Re: [CHECKER] 87 potential array bounds error/buffer overruns in 2.5.53

From: Andreas Henriksson (andreas@fjortis.info)
Date: Thu Jan 30 2003 - 15:08:41 EST


>
> These (potential) reported errors are unfixed:
...
> 1 | /sound/sb_card.c
...

The original message said:
---------------------------------------------------------
[BUG] what if the for loop above ends with i = 0?
/home/yxie/linux-2.5.53/sound/oss/sb_card.c:890:sb_isapnp_probe:
ERROR:BUFFER:890:890:Array bounds error (off < 0) (sb_isapnp_list[i],
max(off) = -1)
}

if(!first || !reverse)
i = isapnpjump;
first = 0;

Error --->
while(sb_isapnp_list[i].card_vendor != 0) {
static struct pci_bus *bus = NULL;

while ((bus = isapnp_find_card(
---------------------------------------------------------

(Hopefully) Relevant loop:
    /* Count entries in sb_isapnp_list */
    for (i = 0; sb_isapnp_list[i].card_vendor != 0; i++);
    i--;

The loop will never end with i=0 unless the card list is
empty. And what use would a driver with an empty card list be? (so that
will never happen. Maybee the checker won't trigger if the cardlist is
marked as "const"? I vote for this to be marked as a non-bug, but
someone else should probably check it too.)

 -- Andreas Henriksson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 31 2003 - 22:00:24 EST