]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Avoid unsigned/signed comparison in loop condition
authorBen Kaduk <kaduk@mit.edu>
Wed, 27 Jun 2012 19:38:47 +0000 (15:38 -0400)
committerBen Kaduk <kaduk@mit.edu>
Tue, 3 Jul 2012 04:43:23 +0000 (00:43 -0400)
The gid_len length is declared as an unsigned int, and loop
index 'i' is a signed int.  This could manifest as an infinite
loop if gid_len is very large.  In practice, gid_len should be small,
but make 'i' the same type for consistency.

src/lib/rpc/svc_auth_unix.c

index 406abf7eb80e263e28bc18c2eaeda6392851b202..a4b87d8ff46923ffe62040c87a301d30414c95b5 100644 (file)
@@ -66,8 +66,7 @@ gssrpc__svcauth_unix(
                char area_machname[MAX_MACHINE_NAME+1];
                int area_gids[NGRPS];
        } *area;
-       u_int auth_len, str_len, gid_len;
-       register int i;
+       u_int auth_len, str_len, gid_len, i;
 
        rqst->rq_xprt->xp_auth = &svc_auth_none;