From a6ee134f7f5da47022145bdb4a8bceff08414465 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Fri, 5 Jul 2019 08:23:10 -0600 Subject: [PATCH] libadmin: overlap warning in strcpy with gcc9 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 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 79dffe29c8a0ec55c4231a18077efdfa7c1edf53) Change-Id: I19a192ecea86314851e6889274eb030c5caff8cb Reviewed-on: https://gerrit.openafs.org/13724 Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Stephan Wiesand --- src/libadmin/adminutil/afs_utilAdmin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libadmin/adminutil/afs_utilAdmin.c b/src/libadmin/adminutil/afs_utilAdmin.c index 05b66b5f0..518365431 100644 --- a/src/libadmin/adminutil/afs_utilAdmin.c +++ b/src/libadmin/adminutil/afs_utilAdmin.c @@ -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]; -- 2.39.5