Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/usr.bin/finger Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/20936414d285
branches:  netbsd-7
changeset: 799863:20936414d285
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Mar 13 12:02:48 2016 +0000

description:
Pull up following revision(s) (requested by chs in ticket #1137):
        usr.bin/finger/util.c: revision 1.29
in find_idle_and_ttywrite(), initialize idletime and writable to 0
when stat() fails.  this prevents a coredump later in stimeprint()
due to gmtime() returning NULL for an uninitialized idletime.

diffstat:

 usr.bin/finger/util.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 0e5f7ceaefd2 -r 20936414d285 usr.bin/finger/util.c
--- a/usr.bin/finger/util.c     Sun Mar 13 11:59:22 2016 +0000
+++ b/usr.bin/finger/util.c     Sun Mar 13 12:02:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.28 2009/04/12 06:18:54 lukem Exp $  */
+/*     $NetBSD: util.c,v 1.28.24.1 2016/03/13 12:02:48 martin Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -72,7 +72,7 @@
 #if 0
 static char sccsid[] = "@(#)util.c     8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: util.c,v 1.28 2009/04/12 06:18:54 lukem Exp $");
+__RCSID("$NetBSD: util.c,v 1.28.24.1 2016/03/13 12:02:48 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -358,6 +358,8 @@
        (void)snprintf(tbuf, sizeof(tbuf), "%s/%s", _PATH_DEV, w->tty);
        if (stat(tbuf, &sb) < 0) {
                warn("%s", tbuf);
+               w->idletime = 0;
+               w->writable = 0;
                return;
        }
        w->idletime = now < sb.st_atime ? 0 : now - sb.st_atime;



Home | Main Index | Thread Index | Old Index