* acl_files.c (canon;): Properly handle appending of the local
authorTom Yu <tlyu@mit.edu>
Wed, 14 Aug 2002 03:09:53 +0000 (03:09 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 14 Aug 2002 03:09:53 +0000 (03:09 +0000)
realm, which was botched due to a buffer-overflow patch.

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

src/kadmin/v4server/ChangeLog
src/kadmin/v4server/acl_files.c

index a21170680e042329e872165014b596d2c438c57a..8865dde4a73c223adb158c897e587eb414ce12cb 100644 (file)
@@ -1,3 +1,8 @@
+2002-08-13  Tom Yu  <tlyu@mit.edu>
+
+       * acl_files.c (canon;): Properly handle appending of the local
+       realm, which was botched due to a buffer-overflow patch.
+
 2001-11-19  Ezra Peisach  <epeisach@mit.edu>
 
        * kadm_server.h: Update prototype for convert_kadm5_to_kadm.
index 8a6118c834c9ef7a74c3106fe5c35a82c9158328..bbc9bb71bb98a898de986602bf2e41f1ef878895 100644 (file)
@@ -142,12 +142,19 @@ char *canon;
            return;
        }
     } else if(krb_get_lrealm(realm, 1) != KSUCCESS) {
-        if(canon + strlen(realm) < canon_save + MAX_PRINCIPAL_SIZE) {
+        if(canon + strlen(KRB_REALM) < canon_save + MAX_PRINCIPAL_SIZE) {
            strcpy(canon, KRB_REALM);
        } else {
            strcpy(canon, "");
            return;
        }
+    } else {
+       if (canon + strlen(realm) < canon_save + MAX_PRINCIPAL_SIZE) {
+           strcpy(canon, realm);
+       } else {
+           strcpy(canon, "");
+           return;
+       }
     }
 }