svn rev #22343: trunk/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Mon May 11 18:46:56 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22343
Commit By: ghudson
Log Message:
ticket: 6200
status: open

In recvauth_common, convert a use of strcpy to strdup.



Changed Files:
U   trunk/src/lib/krb5/krb/recvauth.c
Modified: trunk/src/lib/krb5/krb/recvauth.c
===================================================================
--- trunk/src/lib/krb5/krb/recvauth.c	2009-05-11 22:11:30 UTC (rev 22342)
+++ trunk/src/lib/krb5/krb/recvauth.c	2009-05-11 22:46:56 UTC (rev 22343)
@@ -173,11 +173,11 @@
 		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;




More information about the cvs-krb5 mailing list