Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/login Added namelen initialization in getpeername(3)...



details:   https://anonhg.NetBSD.org/src/rev/37f199492d81
branches:  trunk
changeset: 341235:37f199492d81
user:      shm <shm%NetBSD.org@localhost>
date:      Tue Oct 27 14:53:00 2015 +0000

description:
Added namelen initialization in getpeername(3) call (CID 979631)

OK kamil@

diffstat:

 usr.bin/login/common.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 57cc44695d14 -r 37f199492d81 usr.bin/login/common.c
--- a/usr.bin/login/common.c    Tue Oct 27 14:47:45 2015 +0000
+++ b/usr.bin/login/common.c    Tue Oct 27 14:53:00 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.6 2012/05/19 00:02:44 christos Exp $      */
+/*     $NetBSD: common.c,v 1.7 2015/10/27 14:53:00 shm Exp $   */
 
 /*-
  * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: common.c,v 1.6 2012/05/19 00:02:44 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.7 2015/10/27 14:53:00 shm Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -173,6 +173,7 @@
        int remote;
 
        hname = (hostname == NULL) ? "?" : hostname;
+       alen = sizeof(ass);
        if (getpeername(STDIN_FILENO, (struct sockaddr *)&ass, &alen) != -1) {
                (void)sockaddr_snprintf(assbuf,
                    sizeof(assbuf), "%A (%a)", (void *)&ass);



Home | Main Index | Thread Index | Old Index