From 5209bbdeeb1905a3fa3fa5602975d59472670520 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Mon, 7 Jul 2003 18:21:57 +0000 Subject: [PATCH] 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()) ticket: 1651 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15671 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb4/ChangeLog | 7 +++++++ src/lib/krb4/RealmsConfig-glue.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/krb4/ChangeLog b/src/lib/krb4/ChangeLog index 075416318..702d0220d 100644 --- a/src/lib/krb4/ChangeLog +++ b/src/lib/krb4/ChangeLog @@ -1,3 +1,10 @@ +2003-07-07 Alexandra Ellwood + + * 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 * Makefile.in (KRB_ERR_C): New variable; Darwin needs err_txt.o to diff --git a/src/lib/krb4/RealmsConfig-glue.c b/src/lib/krb4/RealmsConfig-glue.c index 67f95f5dc..26daa0f40 100644 --- a/src/lib/krb4/RealmsConfig-glue.c +++ b/src/lib/krb4/RealmsConfig-glue.c @@ -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) -- 2.26.2