From: Greg Hudson Date: Mon, 11 May 2009 22:46:56 +0000 (+0000) Subject: In recvauth_common, convert a use of strcpy to strdup X-Git-Tag: krb5-1.8-alpha1~480 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dc438115063378d64441939d12c8f37cea0089ec;p=krb5.git In recvauth_common, convert a use of strcpy to strdup ticket: 6200 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22343 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index 2f56e567d..611546aa5 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -173,11 +173,11 @@ recvauth_common(krb5_context context, error.error = KRB_ERR_GENERIC; message = error_message(problem); error.text.length = strlen(message) + 1; - if (!(error.text.data = malloc(error.text.length))) { + error.text.data = strdup(message); + if (!error.text.data) { retval = ENOMEM; goto cleanup; } - strcpy(error.text.data, message); if ((retval = krb5_mk_error(context, &error, &outbuf))) { free(error.text.data); goto cleanup;