From: Simon Wilkinson Date: Sat, 2 Mar 2013 09:19:13 +0000 (+0000) Subject: Unix CM: Make rootVolume array big enough X-Git-Tag: upstream/1.8.0_pre1^2~269 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=86053beac56629f7bdbc2695fda560e0410e430f;p=packages%2Fo%2Fopenafs.git Unix CM: Make rootVolume array big enough 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 Tested-by: BuildBot --- diff --git a/src/afs/afs.h b/src/afs/afs.h index 63fb03dd9..443bd0bc3 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -88,6 +88,7 @@ extern int afs_shuttingdown; #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 diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index dd943a7be..b283f778c 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -306,7 +306,7 @@ afs_Daemon(void) int afs_CheckRootVolume(void) { - char rootVolName[32]; + char rootVolName[MAXROOTVOLNAMELEN]; struct volume *tvp = NULL; int usingDynroot = afs_GetDynrootEnable(); int localcell; diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 636151eee..b6eb2df6b 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -30,7 +30,7 @@ extern void shutdown_bufferpackage(void); /* 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);