From 1d19d863b0033c961c0577df352193884d948c26 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 28 Jan 2003 23:30:02 +0000 Subject: [PATCH] * RealmsConfig-glue.c (get_krbhst_default, krb_get_krbhst, krb_realmofhost): Use strcpy instead of strncpy. ticket: 1339 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15135 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb4/ChangeLog | 5 +++++ src/lib/krb4/RealmsConfig-glue.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 5fcf19ef7..3129e35f1 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,8 @@ +2003-01-28 Ken Raeburn + + * RealmsConfig-glue.c (get_krbhst_default, krb_get_krbhst): + (krb_realmofhost): Use strcpy instead of strncpy. + 2003-01-27 Ken Raeburn * RealmsConfig-glue.c (krb_get_admhst): Use strcpy instead of diff --git a/src/lib/krb4/RealmsConfig-glue.c b/src/lib/krb4/RealmsConfig-glue.c index e71bc0074..9c5a54349 100644 --- a/src/lib/krb4/RealmsConfig-glue.c +++ b/src/lib/krb4/RealmsConfig-glue.c @@ -377,7 +377,7 @@ get_krbhst_default(h, r, n) if (strlen(KRB_HOST) + 1 + strlen(r) >= MAXHOSTNAMELEN) return KFAILURE; /* KRB_HOST.REALM (ie. kerberos.CYGNUS.COM) */ - strncpy(h, KRB_HOST, MAXHOSTNAMELEN); + strcpy(h, KRB_HOST); strcat(h, "."); strcat(h, r); return KSUCCESS; @@ -469,7 +469,7 @@ krb_get_krbhst( } fclose(cnffile); if (result == KSUCCESS && strlen(scratch) < MAXHOSTNAMELEN) - strncpy(host, scratch, MAXHOSTNAMELEN); + strcpy(host, scratch); else result = KFAILURE; } while (0); @@ -598,7 +598,7 @@ krb_realmofhost(char *host) if (strlen(lhost) >= MAXHOSTNAMELEN) return realm; - strncpy(hostname, lhost, MAXHOSTNAMELEN); + strcpy(hostname, lhost); /* Remove possible trailing dot. */ p = strrchr(hostname, '.'); -- 2.26.2