use strlcat/strlcpy, from openbsd

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12046 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-04-16 16:13:08 +00:00
parent c30d73e07e
commit 6223cf0f22
2 changed files with 15 additions and 11 deletions

View File

@@ -52,9 +52,9 @@ _warnerr(krb5_context context, int do_errtext,
args[0] = args[1] = NULL;
arg = args;
if(fmt){
strcat(xfmt, "%s");
strlcat(xfmt, "%s", sizeof(xfmt));
if(do_errtext)
strcat(xfmt, ": ");
strlcat(xfmt, ": ", sizeof(xfmt));
vasprintf(&msg, fmt, ap);
if(msg == NULL)
return ENOMEM;
@@ -63,7 +63,7 @@ _warnerr(krb5_context context, int do_errtext,
if(context && do_errtext){
const char *err_msg;
strcat(xfmt, "%s");
strlcat(xfmt, "%s", sizeof(xfmt));
err_str = krb5_get_error_string(context);
if (err_str != NULL) {