Source-Changes-HG archive

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

[src/trunk]: src/lib/libwrap PR/50823: David Binderman: Limit scanf width



details:   https://anonhg.NetBSD.org/src/rev/185ab237840f
branches:  trunk
changeset: 343630:185ab237840f
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Feb 17 19:52:20 2016 +0000

description:
PR/50823: David Binderman: Limit scanf width

diffstat:

 lib/libwrap/hosts_access.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 01def9ed5c6e -r 185ab237840f lib/libwrap/hosts_access.c
--- a/lib/libwrap/hosts_access.c        Wed Feb 17 19:51:29 2016 +0000
+++ b/lib/libwrap/hosts_access.c        Wed Feb 17 19:52:20 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hosts_access.c,v 1.20 2012/03/21 10:10:37 matt Exp $   */
+/*     $NetBSD: hosts_access.c,v 1.21 2016/02/17 19:52:20 christos Exp $       */
 
  /*
   * This module implements a simple access control language that is based on
@@ -24,7 +24,7 @@
 #if 0
 static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22";
 #else
-__RCSID("$NetBSD: hosts_access.c,v 1.20 2012/03/21 10:10:37 matt Exp $");
+__RCSID("$NetBSD: hosts_access.c,v 1.21 2016/02/17 19:52:20 christos Exp $");
 #endif
 #endif
 
@@ -309,12 +309,12 @@
 static int
 hostfile_match(char *path, struct host_info *host)
 {
-    char    tok[BUFSIZ];
+    char    tok[512];
     int     match = NO;
     FILE   *fp;
 
     if ((fp = fopen(path, "r")) != 0) {
-       while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
+       while (fscanf(fp, "%511s", tok) == 1 && !(match = host_match(tok, host)))
             /* void */ ;
        fclose(fp);
     } else if (errno != ENOENT) {



Home | Main Index | Thread Index | Old Index