summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-10-15 10:36:24 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-15 21:26:31 +0200
commite6a5fdf56e3a5fc179cd8c8c19081a9a11882b0c (patch)
tree5f3d4a36c55195dae85cb8ddfed416b928bb011c /drivers
parent[IPV6]: Avoid skb_copy/pskb_copy/skb_realloc_headroom on input (diff)
downloadlinux-e6a5fdf56e3a5fc179cd8c8c19081a9a11882b0c.tar.xz
linux-e6a5fdf56e3a5fc179cd8c8c19081a9a11882b0c.zip
[NIU]: Fix write past end of array in niu_pci_probe_sprom().
Noticed by Coverity checker and reported by Adrian Bunk. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/niu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 43bfe7e6b6f5..54166bdeae96 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -6213,7 +6213,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np)
val = nr64(ESPC_MOD_STR_LEN);
niudbg(PROBE, "SPROM: MOD_STR_LEN[%llu]\n",
(unsigned long long) val);
- if (val > 8 * 4)
+ if (val >= 8 * 4)
return -EINVAL;
for (i = 0; i < val; i += 4) {
@@ -6229,7 +6229,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np)
val = nr64(ESPC_BD_MOD_STR_LEN);
niudbg(PROBE, "SPROM: BD_MOD_STR_LEN[%llu]\n",
(unsigned long long) val);
- if (val > 4 * 4)
+ if (val >= 4 * 4)
return -EINVAL;
for (i = 0; i < val; i += 4) {