getcbi-limit-addresses-20070208

FIXES 36643

don't write addresses (if we have too many) over random memory
This commit is contained in:
Derrick Brashear 2007-02-09 00:17:24 +00:00
parent a4d52ee772
commit 8ecad072df

View File

@ -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);