From: Greg Hudson Date: Tue, 22 Sep 2009 16:46:06 +0000 (+0000) Subject: Fix a braino in r22782: we don't use strcpy even safely; use strlcpy X-Git-Tag: krb5-1.8-alpha1~340 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3cd5f112cd2890c9647527335fbfb26d008c4ce0;p=krb5.git Fix a braino in r22782: we don't use strcpy even safely; use strlcpy instead. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22783 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index d4bb2bfde..6f8c04b8e 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -1174,7 +1174,7 @@ prepare_dummy_password(char *buf, size_t sz) size_t i; /* Must try to pass any password policy in place, and be valid UTF-8. */ - strcpy(buf, "6F a["); + strlcpy(buf, "6F a[", sz); for (i = strlen(buf); i < sz - 1; i++) buf[i] = 'a' + (i % 26); buf[sz - 1] = '\0';