From ce2df481b775d832e42c878203d55ff1286d2f6d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 5 Sep 2018 14:49:59 +1200 Subject: [PATCH] Fix size types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes compilation with -Wstrict-overflow=2 with CFLAGS="-O3 -Werror=strict-overflow -Wstrict-overflow=2" gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) gives: config_file.c: In function ‘krb5_config_vget_strings’: config_file.c:1122:10: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] while(nstr--) ^ Upstream pull request: https://github.com/heimdal/heimdal/pull/354 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett (similar to Samba commit 72979d1d60ca2eab1e7903c2e77b8cca69667691, cut down to just the config_file.c and keytab_any.c changes reproduced above by abartlet) --- lib/krb5/config_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/krb5/config_file.c b/lib/krb5/config_file.c index 1874de2b4..716413439 100644 --- a/lib/krb5/config_file.c +++ b/lib/krb5/config_file.c @@ -1081,7 +1081,7 @@ krb5_config_vget_strings(krb5_context context, va_list args) { char **strings = NULL; - int nstr = 0; + size_t nstr = 0; const krb5_config_binding *b = NULL; const char *p;