]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Unix CM: Make rootVolume array big enough
authorSimon Wilkinson <sxw@your-file-system.com>
Sat, 2 Mar 2013 09:19:13 +0000 (09:19 +0000)
committerBenjamin Kaduk <kaduk@mit.edu>
Sun, 23 Aug 2015 21:42:19 +0000 (17:42 -0400)
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>
src/afs/afs.h
src/afs/afs_daemons.c
src/afs/afs_prototypes.h

index 63fb03dd9da0bd4d5d9ab8bee23af9c8cd8921d9..443bd0bc32722f2202ec94ab9fb6eeee0a105a97 100644 (file)
@@ -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
 
index dd943a7be28393ead665e07389f36575061e97ea..b283f778cda7fef3efcac40007579e7a8666bfe7 100644 (file)
@@ -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;
index 636151eee34f7306a3b99af786d0cd42a0068e27..b6eb2df6bf44e22e35a7caaadd54cad8668bf0af 100644 (file)
@@ -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);