Module Name: src Committed By: nonaka Date: Mon Feb 23 13:09:37 UTC 2015
Modified Files: src/sys/dev/pci: if_iwm.c Log Message: CID 1271021: Overrunning array "in->in_ridx" of 15 bytes at byte offset 15 using index "i" (which evaluates to 15). http://mail-index.netbsd.org/coverity-updates/2015/02/21/msg000115.html To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/dev/pci/if_iwm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_iwm.c diff -u src/sys/dev/pci/if_iwm.c:1.11 src/sys/dev/pci/if_iwm.c:1.12 --- src/sys/dev/pci/if_iwm.c:1.11 Fri Feb 20 16:16:06 2015 +++ src/sys/dev/pci/if_iwm.c Mon Feb 23 13:09:37 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: if_iwm.c,v 1.11 2015/02/20 16:16:06 nonaka Exp $ */ +/* $NetBSD: if_iwm.c,v 1.12 2015/02/23 13:09:37 nonaka Exp $ */ /* OpenBSD: if_iwm.c,v 1.18 2015/02/11 01:12:42 brad Exp */ /* @@ -105,7 +105,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.11 2015/02/20 16:16:06 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iwm.c,v 1.12 2015/02/23 13:09:37 nonaka Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -5347,8 +5347,12 @@ iwm_setrates(struct iwm_node *in) if (ridx > IWM_RIDX_MAX) DPRINTF(("%s: WARNING: device rate for %d not found!\n", DEVNAME(sc), rate)); - else + else if (i < __arraycount(in->in_ridx)) in->in_ridx[i] = ridx; + else + DPRINTF(("%s: WARNING: out of range: " + "i(%d) >= array size(%zu)\n", DEVNAME(sc), + i, __arraycount(in->in_ridx))); } /* then construct a lq_cmd based on those */