From 8ecad072df8f6cfa63e1ef4d862611a0f2a75e7b Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Fri, 9 Feb 2007 00:17:24 +0000 Subject: [PATCH] getcbi-limit-addresses-20070208 FIXES 36643 don't write addresses (if we have too many) over random memory --- src/rx/rx_kcommon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index a63c279e6e..8c6eda6dcc 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -520,7 +520,7 @@ shutdown_rxkernel(void) int rxi_GetcbiInfo(void) { - int i, j, different = 0; + int i, j, different = 0, num = ADDRSPERSITE; int rxmtu, maxmtu; afs_uint32 ifinaddr; afs_uint32 addrs[ADDRSPERSITE]; @@ -529,7 +529,9 @@ rxi_GetcbiInfo(void) memset((void *)addrs, 0, sizeof(addrs)); memset((void *)mtus, 0, sizeof(mtus)); - for (i = 0; i < afs_cb_interface.numberOfInterfaces; i++) { + if (afs_cb_interface.numberOfInterfaces < num) + num = afs_cb_interface.numberOfInterfaces; + for (i = 0; i < num; i++) { if (!afs_cb_interface.mtu[i]) afs_cb_interface.mtu[i] = htonl(1500); rxmtu = (ntohl(afs_cb_interface.mtu[i]) - RX_IPUDP_SIZE);