Source-Changes-HG archive

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

[src/netbsd-1-4]: src/libexec/ftpd Pull up revision 1.70 (requested by tron):



details:   https://anonhg.NetBSD.org/src/rev/240a7db1b94d
branches:  netbsd-1-4
changeset: 469526:240a7db1b94d
user:      he <he%NetBSD.org@localhost>
date:      Fri Oct 01 12:08:06 1999 +0000

description:
Pull up revision 1.70 (requested by tron):
  Avoid segmentation fault if there is an empty line in /etc/ftpusers,
  fixing PR#8504.

diffstat:

 libexec/ftpd/ftpd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r 1d23e8aa3a34 -r 240a7db1b94d libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Wed Sep 29 07:17:57 1999 +0000
+++ b/libexec/ftpd/ftpd.c       Fri Oct 01 12:08:06 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.61 1998/12/28 04:54:01 lukem Exp $  */
+/*     $NetBSD: ftpd.c,v 1.61.2.1 1999/10/01 12:08:06 he Exp $ */
 
 /*
  * Copyright (c) 1985, 1988, 1990, 1992, 1993, 1994
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpd.c     8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.61 1998/12/28 04:54:01 lukem Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.61.2.1 1999/10/01 12:08:06 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -486,9 +486,11 @@
 
        while (fgets(line, sizeof(line), fd) != NULL)  {
                glob = strtok(line, " \t\n");
-               if (glob[0] == '#')
+               if (glob == NULL || glob[0] == '#')
                        continue;
                perm = strtok(NULL, " \t\n");
+               if (perm == NULL)
+                       continue;
                if (fnmatch(glob, name, 0) == 0)  {
                        if (perm != NULL &&
                            ((strcasecmp(perm, "allow") == 0) ||



Home | Main Index | Thread Index | Old Index