summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-03-18 15:14:47 +0000
committertedu <tedu@openbsd.org>2015-03-18 15:14:47 +0000
commitae334fbe0ba74ce773d40e4780e232fa75375795 (patch)
treeff23d40c1d7997ccdeef6f1abef35509c19ea469
parentnot necessary to work around an apparent bug on ancient freebsd (diff)
downloadwireguard-openbsd-ae334fbe0ba74ce773d40e4780e232fa75375795.tar.xz
wireguard-openbsd-ae334fbe0ba74ce773d40e4780e232fa75375795.zip
check for invalid disknames
-rw-r--r--usr.sbin/iostat/iostat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index c6029095fd5..ced8091eef4 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.37 2014/10/28 05:48:22 deraadt Exp $ */
+/* $OpenBSD: iostat.c,v 1.38 2015/03/18 15:14:47 tedu Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -416,7 +416,10 @@ selectdrives(char *argv[])
continue;
cur.dk_select[i] = 1;
++ndrives;
+ break;
}
+ if (i == dk_ndrive)
+ errx(1, "invalid interval or drive name: %s", *argv);
}
#ifdef BACKWARD_COMPATIBILITY
if (*argv) {