]> git.michaelhowe.org Git - packages/o/openafs.git/commit
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)
committerStephan Wiesand <stephan.wiesand@desy.de>
Tue, 3 Jun 2014 16:30:57 +0000 (12:30 -0400)
commit2e644c3d860b5576be0cdf69b09b554fc4af1542
treea0d321f35a96bee6975e8d5943255f23bd360a4f
parent16bef5a55429feb067d7db163e102e6322e75485
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)

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>
(cherry picked from commit c0fba6eab519bd1bb6929b788361219f97da7212)

Change-Id: I1e2556df6867ebb7b6b311e54a0271fb6fe631fd
Reviewed-on: http://gerrit.openafs.org/11032
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/bucoord/ubik_db_if.c