rd_req_dec.c (krb5_rd_req_decoded): For heirarchal cross-realm,
authorEzra Peisach <epeisach@mit.edu>
Mon, 23 Oct 1995 16:07:56 +0000 (16:07 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 23 Oct 1995 16:07:56 +0000 (16:07 +0000)
set the length after initializing string.

 rd_req.c (krb5_rd_req): If a new auth_context is created
and then there is an error, make sure return pointer is not
looking at freed memory.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6981 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/rd_req.c
src/lib/krb5/krb/rd_req_dec.c

index 453660d5c8fb8fae3ec0fc39450fb0fd9f10e1a8..4576a03b74096d9121e37f15ef1fd93bde458d5d 100644 (file)
@@ -1,3 +1,13 @@
+Mon Oct 23 11:09:56 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
+
+       * rd_req_dec.c (krb5_rd_req_decoded): For heirarchal cross-realm,
+               set the length after initializing string.
+
+       * rd_req.c (krb5_rd_req): If a new auth_context is created
+               and then there is an error, make sure return pointer is not
+               looking at freed memory.
+
+
 Fri Oct  6 22:04:42 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * Makefile.in: Remove ##DOS!include of config/windows.in.
index 9ed6eb2c9e20b3274263ba1b8dbf9dd7857a120b..e46b3bd913908e7e863bc57866be3f27e14d5de4 100644 (file)
@@ -98,8 +98,10 @@ krb5_rd_req(context, auth_context, inbuf, server, keytab,
         (void) krb5_kt_close(context, new_keytab);
 
 cleanup_auth_context:
-    if (new_auth_context && retval)
+    if (new_auth_context && retval) {
        krb5_auth_con_free(context, new_auth_context);
+       *auth_context = NULL;
+    }
 
 cleanup_request:
     krb5_free_ap_req(context, request);
index c5637d4c1d6d6b01e4853265b7aa24b98d3f65ec..5167701d028a2dd0c13f4da74202c0d308ea36a0 100644 (file)
@@ -197,8 +197,8 @@ krb5_rd_req_decoded(context, auth_context, req, server, keytab,
         * and the local realm.                                        
         */
        if (trans->tr_contents.data && trans->tr_contents.data[0]) {
-            lrealm.length = strlen(lrealm.data);
             krb5_get_default_realm(context, &(lrealm.data));
+            lrealm.length = strlen(lrealm.data);
             retval = krb5_check_transited_list(context, &(trans->tr_contents), 
                                               realm, &lrealm);
             free(lrealm.data);