In afs_CheckRootVolume, the local rootVolumeName array needs to
be large enough to hold the contents of the global
afs_rootVolumeName string, which is 64 characters long. Fix our
local array to be the same length by using a new defined constant
MAXROOTVOLNAMELEN.
Caught by coverity (#985758)
Change-Id: I4c926b94efb40d7107e2d7160ade0ba8b381004e
Reviewed-on: http://gerrit.openafs.org/9348
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
#define MAXVOLS 128 /* max vols we can store */
#define MAXSYSNAME 128 /* max sysname (i.e. @sys) size */
#define MAXNUMSYSNAMES 32 /* max that current constants allow */
+#define MAXROOTVOLNAMELEN 64 /* max length of root volume name */
#define NOTOKTIMEOUT (2*3600) /* time after which to timeout conns sans tokens */
#define NOPAG 0xffffffff
int
afs_CheckRootVolume(void)
{
- char rootVolName[32];
+ char rootVolName[MAXROOTVOLNAMELEN];
struct volume *tvp = NULL;
int usingDynroot = afs_GetDynrootEnable();
int localcell;
/* afs_call.c */
extern int afs_cold_shutdown;
-extern char afs_rootVolumeName[64];
+extern char afs_rootVolumeName[MAXROOTVOLNAMELEN];
extern void afs_shutdown(void);
extern void afs_FlushCBs(void);
extern int afs_CheckInit(void);