Module Name: src Committed By: shm Date: Tue Oct 27 14:53:00 UTC 2015
Modified Files: src/usr.bin/login: common.c Log Message: Added namelen initialization in getpeername(3) call (CID 979631) OK kamil@ To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.bin/login/common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/login/common.c diff -u src/usr.bin/login/common.c:1.6 src/usr.bin/login/common.c:1.7 --- src/usr.bin/login/common.c:1.6 Sat May 19 00:02:44 2012 +++ src/usr.bin/login/common.c Tue Oct 27 14:53:00 2015 @@ -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 @@ update_db(int quietlog, int rootlogin, i 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);