bucoord: Remove theoretical overflow of ubik array
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 1 Mar 2013 11:09:04 +0000 (11:09 +0000)
committerDerrick Brashear <shadow@your-file-system.com>
Mon, 4 Mar 2013 03:01:05 +0000 (19:01 -0800)
commitc0fba6eab519bd1bb6929b788361219f97da7212
tree71719e95b3453e32032b970318b6685756215af3
parent59def405ba9404954debd35da539346b1ccd4096
bucoord: Remove theoretical overflow of ubik array

The ubik connections array is NULL terminated, so we have to
ensure that there is enough space for the trailing NULL. As the
array is MAXSERVERS elements long, this means that we can only
store MAXSERVERS-1 connections in it.

This problem will never be encountered by the correct code, as
the number of hosts returned from afsconf_Open is capped at
MAXHOSTSPERCELL (currently 8). MAXSERVERS is currently 20. However,
fix the bug in case we increase MAXHOSTSPERCELL at some point in
the future.

Caught by coverity (#985576)

Change-Id: Icd3f4afe929cbf05522e44132f055a3955c4d23c
Reviewed-on: http://gerrit.openafs.org/9322
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/bucoord/ubik_db_if.c