libadmin: overlap warning in strcpy with gcc9 60/13660/8
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 5 Jul 2019 14:23:10 +0000 (08:23 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 12 Jul 2019 15:49:29 +0000 (11:49 -0400)
GCC 9 with --enable-checking produces a new warning/error in
afs_utilAdmin.c associated with a strcpy with the potential of an
overlap.  The index used is signed which triggers the new warning. The
source and target of the strcpy are contained within the same higher
level structure.

Change the variable 'index' from signed to unsigned to resolve the
warning/error. Change the variable 'total' in the same structure to
unsigned to be consistent with it's usage with 'index'.

Change-Id: Icaa99e278a5d8262caeaec0b2723e826a57554aa
Reviewed-on: https://gerrit.openafs.org/13660
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/libadmin/adminutil/afs_utilAdmin.c

index 05b66b5..5183654 100644 (file)
@@ -126,8 +126,8 @@ util_AdminErrorCodeTranslate(afs_status_t errorCode, int langId,
  */
 
 typedef struct database_server_get {
-    int total;
-    int index;
+    unsigned int total;
+    unsigned int index;
     struct afsconf_dir *conf;
     struct afsconf_cell cell;
     util_databaseServerEntry_t server[CACHED_ITEMS];