do_tgs_req.c (process_tgs_req): Add check to make sure cname and sname
authorTheodore Tso <tytso@mit.edu>
Tue, 25 Nov 1997 01:03:03 +0000 (01:03 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 25 Nov 1997 01:03:03 +0000 (01:03 +0000)
are non-NULL when syslogging an error because the principals don't
match.

kdc_util.c (limit_string): Check to make sure the input string
is non-NULL before operating on it.

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

src/kdc/ChangeLog
src/kdc/do_tgs_req.c
src/kdc/kdc_util.c

index 674fcc9fd29f360109903a56729f33c161c93069..ab5a7b0f7b301f52292551109fa92219322f51c6 100644 (file)
@@ -1,3 +1,12 @@
+Mon Nov 24 19:57:48 1997  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * do_tgs_req.c (process_tgs_req): Add check to make sure cname and
+               sname are non-NULL when syslogging an error because the
+               principals don't match.
+       
+       * kdc_util.c (limit_string): Check to make sure the input string
+               is non-NULL before operating on it.
+
 Thu Nov 13 20:40:01 1997  Theodore Y. Ts'o  <tytso@mit.edu>
 
        * do_tgs_req.c (process_tgs_req): Only try to return a TGT for a
index 8f1237a2f6f01a457c7fe49810f7071235962bc5..f0b6d8b1ca7645ce3230a72676101957c84f5c1a 100644 (file)
@@ -527,7 +527,9 @@ tgt_again:
                                                &tmp)))
                        tmp = 0;
                krb5_klog_syslog(LOG_INFO, "TGS_REQ %s(%d): 2ND_TKT_MISMATCH: authtime %d, %s for %s, 2nd tkt client %s",
-                      fromstring, portnum, authtime, cname, sname,
+                      fromstring, portnum, authtime,
+                      cname ? cname : "<unknown client>",
+                      sname ? sname : "<unknown server>",
                       tmp ? tmp : "<unknown>");
                goto cleanup;
        }
index 5e5ce0a850abb7401eec054fe41ccb97770ed76d..ac969841a7dbc2ccf4084c4fb1898fa4e16f26ad 100644 (file)
@@ -1405,6 +1405,9 @@ void limit_string(char *name)
 {
        int     i;
 
+       if (!name)
+               return;
+
        if (strlen(name) < NAME_LENGTH_LIMIT)
                return;