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

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Feb 5 16:27:58 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=21901
Commit By: ghudson
Log Message:
ticket: 6372
subject: Fix memory handling bug in mk_req_ext
tags: pullup
target_version: 1.7

In make_etype_list, assign *authdata before we have a chance to fail,
since we may have invalidated the previous value with realloc.



Changed Files:
U   trunk/src/lib/krb5/krb/mk_req_ext.c
Modified: trunk/src/lib/krb5/krb/mk_req_ext.c
===================================================================
--- trunk/src/lib/krb5/krb/mk_req_ext.c	2009-02-05 20:57:09 UTC (rev 21900)
+++ trunk/src/lib/krb5/krb/mk_req_ext.c	2009-02-05 21:27:54 UTC (rev 21901)
@@ -391,6 +391,7 @@
 	krb5_free_data(context, ad_if_relevant);
 	return ENOMEM;
     }
+    *authdata = adata;
 
     adata[i] = (krb5_authdata *)malloc(sizeof(krb5_authdata));
     if (adata[i] == NULL) {
@@ -405,8 +406,6 @@
 
     adata[i + 1] = NULL;
 
-    *authdata = adata;
-
     return 0;
 }
 




More information about the cvs-krb5 mailing list