From 1eb610d162de8470b53b3e31629932ca7726a142 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 28 Feb 2002 20:15:06 +0000 Subject: Update. 2002-02-28 Ulrich Drepper * login/login.c (login): Always initialize ut_line field [PR libc/2991]. --- ChangeLog | 5 +++++ login/login.c | 7 ++++++- stdlib/Versions | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94ae6c4..bd44bd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-02-28 Ulrich Drepper + + * login/login.c (login): Always initialize ut_line field + [PR libc/2991]. + 2002-02-28 Jakub Jelinek * sysdeps/i386/Makefile (sysdep_routines): Add diff --git a/login/login.c b/login/login.c index a7a3ff5..6efa762 100644 --- a/login/login.c +++ b/login/login.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include #include #include #include @@ -133,6 +134,10 @@ login (const struct utmp *ut) if (tty != _tty) free (tty); /* Free buffer malloced by tty_name. */ } + else + /* We provide a default value so that the output does not contain + an random bytes in this field. */ + strncpy (copy.ut_line, "???", UT_LINESIZE); /* Update the WTMP file. Here we have to add a new entry. */ updwtmp (_PATH_WTMP, ©); diff --git a/stdlib/Versions b/stdlib/Versions index 274013f..c2e17e0 100644 --- a/stdlib/Versions +++ b/stdlib/Versions @@ -93,6 +93,9 @@ libc { GLIBC_PRIVATE { # functions which have an additional interface since they are # are cancelable. - __libc_system; __on_exit; + __libc_system; + + # functions used in other libraries. + __on_exit; } } -- cgit v1.1