krb_prof_get_nth() no longer assumes that its retlen argument is correct (call strcpy...
authorAlexandra Ellwood <lxs@mit.edu>
Mon, 7 Jul 2003 18:21:57 +0000 (18:21 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Mon, 7 Jul 2003 18:21:57 +0000 (18:21 +0000)
ticket: 1651

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15671 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb4/ChangeLog
src/lib/krb4/RealmsConfig-glue.c

index 07541631812ae35927ef57d6ac0b2658c0867966..702d0220d5d5bd641880673b84764b5f6c174c6e 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-07  Alexandra Ellwood  <lxs@mit.edu>
+
+        * RealmsConfig-glue.c: krb_prof_get_nth() no longer assumes that
+        its retlen argument is correct (call strcpy instead of strncpy)
+        because this argument is a guess for some callers 
+        (eg: krb_get_admhst())
+
 2003-06-11  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (KRB_ERR_C): New variable; Darwin needs err_txt.o to
index 67f95f5dcec819a667ab3f8bf0e33e71c06576d8..26daa0f40ba1c9a758cc8f10561efe13469c3661 100644 (file)
@@ -143,10 +143,11 @@ krb_prof_get_nth(
     }
     if (result == KSUCCESS) {
        /* Return error rather than truncating. */
+       /* Don't strncpy because retlen is a guess for some callers */
        if (strlen(value) >= retlen)
            result = KFAILURE;
        else
-           strncpy(ret, value, retlen);
+           strcpy(ret, value, retlen);
     }
 cleanup:
     if (name != NULL)