From 7b1f8cf3780b6a90dedd82c41e27be016486ac74 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 2 Nov 2011 10:28:35 -0500 Subject: [PATCH] afs: Only use actual connections for GetTime calls The for() loop that makes an RXAFS_GetTime call in afs_CheckServers was iterating over conns and rxconns from 0 to j. However, 'j' here is just the size of the allocated array, whereas 'nconns' is the number of structures in the array actually initialized. So, just go up to nconns to avoid using unitialized connections and Rx connections. This is a 1.6-only change. On master, the -settime code has been completely removed in change Id291f5f88b1ad84594706f2a1a02a933dddd0cb9. Issue reported by Sebastian Hanigk. Change-Id: Iec782a4464899b5a7e49e193b04f79e31c6b37f2 Reviewed-on: http://gerrit.openafs.org/5788 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/afs_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index a9fd5d993..fa211aa61 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -693,7 +693,7 @@ afs_CheckServers(int adown, struct cell *acellp) } multi_End; } else { /* find and query setTimeHost only */ - for ( i = 0 ; i < j ; i++ ) { + for ( i = 0 ; i < nconns ; i++ ) { if ( conns[i] == NULL || conns[i]->srvr == NULL ) continue; if ( conns[i]->srvr->server == afs_setTimeHost ) { -- 2.39.5