From 31a93cf9b57145b1cf92119d736247aa832340f2 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Thu, 28 Jun 2001 12:20:34 +0000 Subject: [PATCH] * update_utmp.c (pty_update_utmp): Don't copy host if it's a null pointer git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13524 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/ChangeLog | 5 +++++ src/util/pty/update_utmp.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index 3a136cdfb..d598f954a 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,8 @@ +2001-06-28 Ken Raeburn + + * update_utmp.c (pty_update_utmp): Don't copy host if it's a null + pointer. + 2001-06-21 Ezra Peisach * libpty.h: Change variable line in prototype to tty_line to diff --git a/src/util/pty/update_utmp.c b/src/util/pty/update_utmp.c index e47fede75..21f1fab6d 100644 --- a/src/util/pty/update_utmp.c +++ b/src/util/pty/update_utmp.c @@ -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)); -- 2.26.2