From f7836ff4786ccd765a596c619162aa8113029555 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 11 Dec 2001 17:51:58 +0000 Subject: [PATCH] * kdc_util.c (subrealm, add_to_transited): Unsigned vs. signed int fixes. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14064 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 5 +++++ src/kdc/kdc_util.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index b411e1dc9..ed660dea6 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,8 @@ +2001-12-11 Ezra Peisach + + * kdc_util.c (subrealm, add_to_transited): Unsigned vs. signed int + fixes. + 2001-10-25 Tom Yu * do_as_req.c (process_as_req: Treat SUPPORT_DESMD5 as if it were diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 5c23e349a..c0c35dad4 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -499,7 +499,7 @@ subrealm(r1,r2) char *r1; char *r2; { - int l1,l2; + size_t l1,l2; l1 = strlen(r1); l2 = strlen(r2); if(l2 <= l1) return(0); @@ -732,10 +732,10 @@ add_to_transited(tgt_trans, new_trans, tgs, client, server) } strncat(current, ",", sizeof(current) - 1 - strlen(current)); if (pl > 0) { - strncat(current, realm, pl); + strncat(current, realm, (unsigned) pl); } else { - strncat(current, realm+strlen(realm)+pl, -pl); + strncat(current, realm+strlen(realm)+pl, (unsigned) (-pl)); } } @@ -758,10 +758,10 @@ add_to_transited(tgt_trans, new_trans, tgs, client, server) goto fail; } if (pl1 > 0) { - strncat(current, realm, pl1); + strncat(current, realm, (unsigned) pl1); } else { - strncat(current, realm+strlen(realm)+pl1, -pl1); + strncat(current, realm+strlen(realm)+pl1, (unsigned) (-pl1)); } } else { /* If not a subrealm */ @@ -787,10 +787,10 @@ add_to_transited(tgt_trans, new_trans, tgs, client, server) strncat(current,",", sizeof(current) - 1 - strlen(current)); current[sizeof(current) - 1] = '\0'; if (pl > 0) { - strncat(current, exp, pl); + strncat(current, exp, (unsigned) pl); } else { - strncat(current, exp+strlen(exp)+pl, -pl); + strncat(current, exp+strlen(exp)+pl, (unsigned)(-pl)); } } } -- 2.26.2