summaryrefslogtreecommitdiff
path: root/sys/src/9/zynq
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-25 03:03:24 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-25 03:03:24 +0100
commit4687e196cc6afa63754f8928154dc3bbf276dda5 (patch)
tree653bae5b0e8330976a68affeb322b6ed16cbbd86 /sys/src/9/zynq
parent0bc9ad781fdc9e4cfcd5fed1560775e241a366fc (diff)
zynq: fix out of bounds access in etherprobe()
calling etherprobe() with -1 cardno will rereference and call cards[-1].reset() which is wrong. don't do that!
Diffstat (limited to 'sys/src/9/zynq')
-rw-r--r--sys/src/9/zynq/devether.c6
-rw-r--r--sys/src/9/zynq/etherif.h2
2 files changed, 1 insertions, 7 deletions
diff --git a/sys/src/9/zynq/devether.c b/sys/src/9/zynq/devether.c
index c6ed2eac3..90777e6f5 100644
--- a/sys/src/9/zynq/devether.c
+++ b/sys/src/9/zynq/devether.c
@@ -435,12 +435,6 @@ etherreset(void)
Ether *ether;
int cardno, ctlrno;
- for(ctlrno = 0; ctlrno < MaxEther; ctlrno++){
- if((ether = etherprobe(-1, ctlrno)) == nil)
- continue;
- etherxx[ctlrno] = ether;
- }
-
cardno = ctlrno = 0;
while(cards[cardno].type != nil && ctlrno < MaxEther){
if(etherxx[ctlrno] != nil){
diff --git a/sys/src/9/zynq/etherif.h b/sys/src/9/zynq/etherif.h
index d7ea87523..80a39aa8b 100644
--- a/sys/src/9/zynq/etherif.h
+++ b/sys/src/9/zynq/etherif.h
@@ -1,5 +1,5 @@
enum {
- MaxEther = 64,
+ MaxEther = 1,
Ntypes = 8,
};