* update_utmp.c (pty_update_utmp): Don't copy host if it's a null pointer
authorKen Raeburn <raeburn@mit.edu>
Thu, 28 Jun 2001 12:20:34 +0000 (12:20 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 28 Jun 2001 12:20:34 +0000 (12:20 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13524 dc483132-0cff-0310-8789-dd5450dbe970

src/util/pty/ChangeLog
src/util/pty/update_utmp.c

index 3a136cdfb1a46a423387dc6e83fd899097607c58..d598f954a45839a03e8bd3cf64beead687e6aaa5 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-28  Ken Raeburn  <raeburn@mit.edu>
+
+       * update_utmp.c (pty_update_utmp): Don't copy host if it's a null
+       pointer.
+
 2001-06-21  Ezra Peisach  <epeisach@mit.edu>
 
        * libpty.h: Change variable line in prototype to tty_line to
index e47fede75168b43cdd9a78df8e39d323f083795f..21f1fab6d57b3e2e05cb7bae056a1811f0367b8b 100644 (file)
@@ -641,7 +641,8 @@ pty_update_utmp(int process_type, int pid, const char *username,
 
     memset(&ent, 0, sizeof(ent));
 #ifdef HAVE_STRUCT_UTMP_UT_HOST
-    strncpy(ent.ut_host, host, sizeof(ent.ut_host));
+    if (host)
+       strncpy(ent.ut_host, host, sizeof(ent.ut_host));
 #endif
     strncpy(ent.ut_name, username, sizeof(ent.ut_name));
     strncpy(ent.ut_line, line, sizeof(ent.ut_line));