From: Ezra Peisach Date: Mon, 5 Feb 2007 20:39:59 +0000 (+0000) Subject: krb5_kt_default_name should take an unsized length X-Git-Tag: krb5-1.7-alpha1~1292 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b3905cfa0fb545e8aafb20ed92a2bff1a85c497c;p=krb5.git krb5_kt_default_name should take an unsized length The internal code to krb5_kt_default_name was casting the length to size_t. Change prototype to take an unsigned - which makes sense in how the code uses it. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19144 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index a404b2531..cfaa90493 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -1573,7 +1573,7 @@ krb5_error_code KRB5_CALLCONV krb5_kt_resolve krb5_error_code KRB5_CALLCONV krb5_kt_default_name (krb5_context, char *, - int ); + size_t ); krb5_error_code KRB5_CALLCONV krb5_kt_default (krb5_context, krb5_keytab * ); diff --git a/src/lib/krb5/os/ktdefname.c b/src/lib/krb5/os/ktdefname.c index 62465f102..925b6e1b5 100644 --- a/src/lib/krb5/os/ktdefname.c +++ b/src/lib/krb5/os/ktdefname.c @@ -37,18 +37,18 @@ extern char *krb5_defkeyname; char *krb5_overridekeyname = NULL; krb5_error_code KRB5_CALLCONV -krb5_kt_default_name(krb5_context context, char *name, int namesize) +krb5_kt_default_name(krb5_context context, char *name, size_t namesize) { char *cp = 0; char *retval; if (krb5_overridekeyname) { - if ((size_t) namesize < (strlen(krb5_overridekeyname)+1)) + if (namesize < (strlen(krb5_overridekeyname)+1)) return KRB5_CONFIG_NOTENUFSPACE; strcpy(name, krb5_overridekeyname); } else if ((context->profile_secure == FALSE) && (cp = getenv("KRB5_KTNAME"))) { - if ((size_t) namesize < (strlen(cp)+1)) + if (namesize < (strlen(cp)+1)) return KRB5_CONFIG_NOTENUFSPACE; strcpy(name, cp); } else if ((profile_get_string(context->profile, @@ -56,7 +56,7 @@ krb5_kt_default_name(krb5_context context, char *name, int namesize) "default_keytab_name", NULL, NULL, &retval) == 0) && retval) { - if ((size_t) namesize < (strlen(retval)+1)) + if (namesize < (strlen(retval)+1)) return KRB5_CONFIG_NOTENUFSPACE; strcpy(name, retval); profile_release_string(retval); @@ -73,7 +73,7 @@ krb5_kt_default_name(krb5_context context, char *name, int namesize) sprintf(name, krb5_defkeyname, defname); } #else - if ((size_t) namesize < (strlen(krb5_defkeyname)+1)) + if (namesize < (strlen(krb5_defkeyname)+1)) return KRB5_CONFIG_NOTENUFSPACE; strcpy(name, krb5_defkeyname); #endif