summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-19 06:34:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-11-19 06:34:04 +0000
commit2054cbdef773c30f79a92a4568b4ae216c4d5b63 (patch)
tree9f9f36f385f0ee0b9d482450859268280ad2f14c /usr.sbin
parent56364e26ede9ab93ce2df17f909e3b8548917bb3 (diff)
catch extra junk at the end of the numbers
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/inetd/inetd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index efe2a2c40ce..065ef1b304c 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inetd.c,v 1.51 1998/11/18 23:25:35 deraadt Exp $ */
+/* $OpenBSD: inetd.c,v 1.52 1998/11/19 06:34:03 deraadt Exp $ */
/* $NetBSD: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $ */
/*
* Copyright (c) 1983,1991 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/
-static char rcsid[] = "$OpenBSD: inetd.c,v 1.51 1998/11/18 23:25:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: inetd.c,v 1.52 1998/11/19 06:34:03 deraadt Exp $";
#endif /* not lint */
/*
@@ -1209,10 +1209,11 @@ more:
cp = ccp + 1;
l = strtol(cp, &ccp, 0);
if (ccp == cp || l < 0 || l > INT_MAX ||
- l < sep->se_rpcversl)
+ l < sep->se_rpcversl || *ccp)
goto badafterall;
sep->se_rpcversh = l;
- }
+ } else if (*ccp != '\0')
+ goto badafterall;
}
}
arg = skip(&cp);