]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
libadmin: overlap warning in strcpy with gcc9
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 5 Jul 2019 14:23:10 +0000 (08:23 -0600)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 9 Aug 2019 14:59:29 +0000 (10:59 -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'.

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

Change-Id: I19a192ecea86314851e6889274eb030c5caff8cb
Reviewed-on: https://gerrit.openafs.org/13724
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/libadmin/adminutil/afs_utilAdmin.c

index 05b66b5f09b588d5cb6b585fae01ae9067fba014..518365431d15c29183424f380b41393262c03892 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];